Error汇总
(2014-03-19 17:11:09)错误:ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture i386
原因:不支持低版本的系统如3.0
解决:Deployment Target was 3.0. Changing it to 4.3 fixed it.
编译的时候会有missing file的警告,原因是由于SVN或git造成的
只要根据警告,每个都使用命令svn rm 丢失文件的路径即可。
http://blog.youkuaiyun.com/wbw1985/article/details/17003773
ld: 16 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方法:
选中工程,target,切换到buildsetting标签,定位到other link flag,
输入: 去除-all_load,即可
http://blog.youkuaiyun.com/wbw1985/article/details/12017273
XCODE4升级到XCODE5编译就不通过了错误如下:
ld: warning: directory not found for option '-L/Users/paul/Android/baidu_tongji_source/ios-sdk/BaiduMobStatSample/../BaiduMobStat/DerivedData/BaiduMobStat/Build/Products/Debug-iphoneos'
ld: warning: ignoring file /Users/paul/Library/Developer/Xcode/DerivedData/BaiduMobStatSample-eqytpjphifilvcdgslntaglo
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方法:
找到Valid Architectures选择armv7和armv7s两项,其余删除
此时clean工程 编译如果还出现该错误,请找到Build Active Architecture Only项选择YES,然后编译通过后再改回NO。之后就正常了。
http://blog.youkuaiyun.com/wbw1985/article/details/12004303
xcode5编译脚本变化
ARCH="armv7s armv7"
echo
xcodebuild -project BaiduMobStat/BaiduMobStat.xcodeproj
在xcode5之前的版本是正常的
但是在xcode5上编译后出现如下问题:
No architectures to compile for (ARCHS=armv7s\ armv7, VALID_ARCHS=armv7 armv7s arm64 i386).
ARCHS参数里面的值包含了斜杠,造成编译不过。改为
xcodebuild -project BaiduMobStat/BaiduMobStat.xcodeproj
编译通过。
常遇见的警告、错误以及相关解决方法
http://blog.youkuaiyun.com/xietao3/article/details/17615251
从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。
1,警告:“xoxoxoxo”
解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。
2,警告:Declaration of "struct sockaddr" will not be visible outside of this function
解决办法:在你的开源.m文件中添加 #import
3,警告:Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'
解决办法:类型不匹配。跳到出错的那一行,UIInterfaceOrientation强制转换为UIDeviceOrientation就行了。
4,警告:incompatible pointer types assigning to 'MyArrayList*'from 'NSMutableArray'
解决办法:加入强制转换(MyArrayList*)
5,警告:'&&' within '||'
问题出处:
6,警告:Warning:The Copy Bundle Resources build phase contains this target's Info.plist file
解决办法:将Info.plist文件移到Resources目录下,而不要直接放在target下。
7,警告:在使用ASIHttp…第三方库的,运行报错。
解决办法:看你的项目中是否添加CFNetwork.framework、SystemConfiguration.framework, MobileCoreServices.framework,
CoreGraphics.framework和libz.1.2.3.dylib,如果是sdk5.0以上,改添加libz.1.2.5.dylib
解决办法:如果是错误信息的话:Target->Build Settings->Search Paths, 删除FrameworkSearch Paths 里面内容就可以了。
要只是一个警告的话,真机调试可以过。具体解决方法待大神出现。
9,警告:
clang: error:
clang: error: no input files
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
解决办法: 在你的主工程文件 target搜素,pch ,找到Prefix Header
10,警告:
“ARC forbids synthesizing a property of an Objective-C object with unspecified ownership or storage attribute
解决办法:如果定义了ARC有效,那么必须要有所有者属性的定义;所以代码改成下面这样
@property
11,警告:
io6一下的xib系统均没有自动选择Use Autolayout, Supporting iOS 5 and below with xib of iOS 6
解决办法:Just un-select “Use Autolayout” in the file inspector of the xib’s view and we are back to the familiar autosizing in size inspector and boom, it supports iOS 5 and below.
12,警告:
Warning:Multiple build commands for output file xxx.png
解决办法:找到项目里xxx.png重复,删除重复的资源。
//以下是升级到 xcode 5.0.1 之后使用遇到的警告
13,警告:
解决办法:删除模拟器上当前要运行那个APP,重新运行项目。就ok
14,警告:
SpringBoard无法启动应用程序 错误:-3
解决办法:退出模拟器,重新运行这个项目。
15,警告:
The server certificate failed to verify.
解决办法:
1、打开终端(实用工具 -->终端),在终端中输入如下命令:
svn ls
然后直接输入 “ p ”
16,警告:
Bitmasking for introspection of Objective-C object pointers is strongly discouraged.
解决办法:
某数字& 0x1的时候是代表要取最低位是否为1,改成了
17,警告:
Implicit conversion loses integer precision: 'unsigned long' to 'CC_LONG' (aka 'unsigned int').
解决办法:
18,警告:
error: failed to launch '/private/var/mobile/Applications/xxxxx' -- failed to get the task for process 11140.
解决办法:
21,
ld: symbol(s) not found for architecture i386
clang: error:
解决方法:
22,
Couldn't register dy.CKRiLiText with the bootstrap server. Error:unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.Current language:
解决方法:可能是电脑内存问题引起,重启电脑即可解决。如果重启解决不了问题,那就是你刚刚改动的代码引起的问题。
23 、 错误信息:
ios 5是调试正常的,ios 6真机调试的时候,出现如下错误:ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/mac4/Desktop/my desktop/My app/MyApp name 20:09:12
解决方法:在Xcode里,点击相应的Target,然后点Build Settings,找到VALID_ARCHS,看里面的是不是arvm7s,如果不是改成arvm7s就可以了。
24 、 错误信息:
ViewController 中没有声明一个方法选择'hideSearchBar:
解决方法:
在ViewController .h 中声明一下这个方法 “
25、 错误信息:当json从服务端请求时得到的字符串,如果这样写的话,会报错,';' after top level declarator
NSString *ss= @"{"recommend":"世界末日","dogname":"机器人"}";
解决方法:
就是,把
26 、 错误信息:
解决方法:
31,警告:
解决办法: 检查 BOOL *换为BOOL就可以了,检查是不是多写一个
32:Jsonkit中的警告
Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()
object->isa 替换为 object_getClass(object)
keyObject->isa 替换为 object_getClass(keyObject)
(id)keys[idx]->isa 替换为 object_getClass((id)keys[idx])
format specifies type 'unsigned long' but the argument has type 'nsuinteger' (aka 'unsigned int')
给变量增加(unsigned long)进行类型转换
33:md5加密(iOS SDK中自带了CommonCrypto
Implicit declaration of function 'CC_MD5' is invalid in C99
[plain] view plaincopy
引入函数定义的头文件
#import
34:ASIDataDecompressor中的警告
format specifies type
在+ (NSError *)deflateErrorWithCode:(int)code 和 +(NSError *)inflateErrorWithCode:(int)code中
[NSString stringWithFormat:@"Compression of data failed with code %hi",code] 中
将code改为 (short)code,类型转换
35:Reachability中警告
Using 'stringWithString:' with a literal is redundant
statusString = [NSString stringWithString: @"Not Reachable"];
改为:statusString = @"Not Reachable";
36.format specifies type 'id' but the argument has type 'const char *'
NSCAssert(NO, @"Unhandled error encountered during SAX parse. msg is %@", msg);
改为:NSCAssert(NO, @"Unhandled error encountered during SAX parse. msg is %@", [NSString stringWithUTF8String:msg]);
37
改为:self.locationInput.text = @"captured change";
38 在项目中设置控件的layer属性时,会发生错误,
"Property 'c' cannot be found in forward class object 'CALayer *",
这时需要引入
41,错误
Error launching remote program: failed to get the task for process
解决方法:
把真机上的软件,删除,然后,clean 一下,重新运行就可以了。
42,真机调试的时候,出现
这正常,但是不识别机器的。
解决方法:
把 ,
43,真机调试的时候,出现
解决方法:
:推出xcode
:断开机器(iphone,ipad,ipod)链接
:重启iPhone在联接xcode,就可以了。