xcode开发中 各种警告

本文汇总了Xcode开发过程中常见的六种错误及警告,并提供了详细的解决步骤。包括处理缺失文件、编译器选择、声明可见性、代码签名验证失败、链接器警告以及应用架构缺失等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 一,Missing file xxx
      如果你在finder中删除了工程里面的文件,xcode上会出现一个警告,Missing file xxx, 有个警告在那恨事不自在.上网着了下,发现了如下解决方法: 
1.打开terminal, cd 到刚才你删除的文件的文件夹,就是xcode提示你missing的文件夹 
2.执行 svn delete missFileName

 二,LLVM GCC Warning
4.3默认使用的是ARC编译,不是原来的GCC编译,所以你编译老程序的话,改回GCC编译看行不行
具体改 :选中 project->build setting->build options->complier for c/objective-c/c++ -> LLVM GCC 4.2

 三,declaration of will not be visible outside of this function
  + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*)hostAddress;(这里报的)
   解决方法:Add #import <netinet/in.h> in Reachability.h to get away with this

四,Application failed code sign verification
    解决 办法:Target设置----->build------>Validate Built Product选项去掉就可以了

五,ld: warning: directory not found for option ' '
   ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../Google Analytics SDK/Library'
解决方法 : 
   选择项目名称----->Targets----->Build Settings----->Search Paths----->Library Search Paths
   删除对应路径

六,Unable to extract entitlements from application

出错信息

  • iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6
  • Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate.
  • Unable to extract entitlements from application: (null)
解决方法
Your problem may due to an invalid setting for the Build Variants build setting. Valid settings are  normal profile, and  debug. For submission to the app store, this setting should be  normal.

Here’s how to fix this:

First update the Project build settings:

  • Click on Project -> <your project> -> Build Settings
  • Search for “build variants”
  • Click on the arrow icon next to Build Variants in the search results to expand the section
  • Remove any existing entries and replace them with normal

Next update the Target build settings:

  • Click on Targets -> <your project> -> Build Settings
  • Search for “build variants”
  • Click on the arrow icon next to Build Variants in the search results to expand the section
  • Remove any existing entries and replace them with normal
原文:http://stackoverflow.com/questions/10540848/validating-an-iphone-app-archive


解决警告“ld: warning: directory not found for option”

  (2013-06-02 03:01:56)
标签: 

it

分类: iOS开发
从项目中删除了某个目录、文件以后,编译出现警告信息:

ld: warning: directory not found for option“XXXXXX”

很奇怪,为什么已经从项目中删除了文件和文件夹还是报这个警告呢?


去掉警告的办法如下:


1选择工程, 编译的 (targets)

2选择 Build Settings 菜单

3查找 Library Search Paths 和 Framework Search Paths, 删掉编译报warning的路径即OK



xcode中 有时候会报一个警告: 
[WARN]Warning: Multiple build commands for output file /xxx 

要解决这个问题很简单: 

1.选择你的工程 
2.选择target 
3.点击 Build Phases 
4.展开Copy Bundle Resources 
5.删除里面的刚才提示警告的文件,一般为红色的名字的文件


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值