经常碰到的xcode报错提示

1. ---- 真机调试Your build settings specify a provisioning profile with the UUID “48f08a3c-

没指定或没指定对provision file 而导致的错误
可以跳转文件到目录 /users/youraccout/Library/M
obileDevice/Provisioning Profiles/  移除所有的已存在的provision file. 去developer 的member center, 下载新的provision file 双击导入。在xcode中重新配置即可。 


2. ---- 6.0 error:-fembed-bitcode is not supported on versions of iOS prior to 6.0

解决方法:ld: '/Users/bianxiang/Desktop/个人项目/WatchFeast更新了/WatchFeast/ShareSDK/Connection/QZoneConnection.framework/QZoneConnection' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

iOS6在Build Settings里面 将Enable Bitcode设置为 NO  编译通过

3. ----  解决reason: 'Application windows are expected to have a root view controller at the.....

解决方法

UIViewController *rootViewController=[[UIViewController allocinit];

    self.window.rootViewController = rootViewController;

    [self.window addSubview:rootViewController.view];

4 ---- 关于数据库 崩溃在这里


*出现该情况 90%是由于数据库少写了传进去的参数 或者没有传入参数或传入的参数类型不对!


5.真机调试 Xcode真机测试could not find developer disk image解决方法

在使用Xcode进行真机调试的时候,有时根据真机的系统不同,会出现could not find developer disk image 错误,这是由于真机系统过高或者过低,Xcode中没有匹配的配置包文件,我们可以通过这个路径进入配置包的存放目录:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

里面有类似这样的一些文件夹,如果这些文件夹中没有包含我们真机的系统,则不能进行真机测试。但是我们可以通过将相应的配置包添加入这个文件夹来解决问题:

说了解决的方法,不提供文件,会让大家觉得坑爹,下面给大家一个链接,里面有从iOS4.2到9.1所有版本的配置包,大家各取所需,不用感谢我:

ios9.1及以前:http://pan.baidu.com/s/1qWIfrqc

ios9.2:http://download.csdn.net/detail/wokenshin/9354083


6. While reading /Users/lejian/lejianapp/demo/Images/设置/背景@2x.png pngcrush caught libpng error:

   \235

原因1. 是提示的png并不是ps导出的png,而是手动修改jpeg后缀名为png,在模拟器上不会报错,但在真机,不  识别这种所谓  的“png”图片。(随便批下美工)

 原因2:这是因为png图片的问题,png图片在存储的时候有一个NOT INTERLACED/INTERLACED(无交错/交错)的选项,因为设计师在切图的时候的存储错误,图片在XCode中就会报这个错误,但是还是会编译成功并运行,请设计师将图片重新按无交错存储就行了。

 

  解决方案:

 用ps重新导出png就ok了



7.Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x687ef50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key datePicker.'

原因:第一种出错的原因可能是错误的IBOutlet连接,即xib中定义了某个IBOutlet,但是在对应的头文件中,该IBOutlet已经被修改或删除。要检查这一问题,可以打开xib文件,在File's Owner上点击右键,然后在弹出的窗口中检查是否有“惊叹号”提示的IBOutlet连接,基本上可以找到问题所在。

第二种出错的原因可能是在xib文件中没有正确指定对象的类。要检查这一问题,可以打开xib文件,查看自定义视图控制器或者视图的Custom Class是否定义正确即可。



8.The operation couldn’t be completed.
重启模拟器即可

9. 推送问题--
did Fail To Register For Remote Notifications With Error: Error Domain=NSCocoaErrorDomain Code=3000 " 未找到应用程序的 “aps-environment” 的授权字符串 " UserInfo=0x1708ee70 {NSLocalizedDescription= 未找到应用程序的 “aps-environment” 的授权字符串 }

Provisioning Profile文件错误

10.引入第三方库出现file not found

比如iOS 引入支付宝 缺少 #include <openssl/asn1.h>

解决方法如下:在你的Xcode里的header search paths 里添加支付宝SDK(openssl的路径);格式如下  $(PROJECT_DIR)/文件夹名         (这里说一下,直接点击openssl,然后showinfinder,然后command + i  查看路径,把得到路径的工程名字以后的部分加在文件夹名这OK了)



11. 

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain:

ProcessPCH++ "/Users/xxxx/Library/Developer/Xcode/DerivedData/English_Reader-alybxowggrudboejoylghzohavko/Build/Intermediates/PrecompiledHeaders/English Reader-Prefix-fldqdedtnerfrubpymgklsjvzccz/English Reader-Prefix.pch.pth" "English Reader/English Reader-Prefix.pch" normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler

clang: error: invalid deployment target for -stdlib=libc++ (requires iOS 5.0 or later)

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1


解决方法:

将Apple LLVM compiler 4.1 - Language ->c++ Standard Library 修改为 libstdc++ (GNU C++ standard library)


12.linker command failed with exit code 1 (use -v to see invocation)


1.以如下错误为例,如果是多人开发,你同步完成后发现出现如下的错误。

[html]  view plain copy
  1. Undefined symbols for architecture armv7:  
  2.   "_OBJC_CLASS_$_MyPageLogViewController", referenced from:  
  3.       objc-class-ref in BaiduMobStatAppDelegate.o  
  4. ld: symbol(s) not found for architecture armv7  
  5. clang: error: linker command failed with exit code 1 (use -v to see invocation)  

错误中出现了“MyPageLogViewController”这个类,你可以找到这个类的.m文件, 查看他的Target Membeship, 如下图

如果没有勾选上,点击勾选。然后编译查看。


2. 如果是新添加的第三方库,且不是静态库

先重复第一步过程,然后找到 Build settings->Linking->Other Linker Flags


将此属性修改成-all_load  或者 -ObjC ,这个视情况而定。总之可以多试几次。


3.如果添加的是第三方静态库(.a文件)

[html]  view plain copy
  1. Undefined symbols for architecture armv7:  
  2.   "_OBJC_CLASS_$_BaiduMobStat", referenced from:  
  3.       objc-class-ref in BaiduMobStatAppDelegate.o  
  4.       objc-class-ref in MyPageLogViewController.o  
  5.      (maybe you meant: _OBJC_CLASS_$_BaiduMobStatAppDelegate)  
  6. ld: symbol(s) not found for architecture armv7  
  7. clang: error: linker command failed with exit code 1 (use -v to see invocation)  

在用到这个库的所有文件中都出现了错误, 如上 BaiduMobStatAppDelegate 类和 MyPageLogViewController类

这种情况就可能是这个静态库路径混乱导致的链接错误

解决方法:Build settings->Search Path->Library Search Paths  添加静态库的相应路径。如下图



如果上面的所有方法都不管用。你可以再试试一下几个方法:

1,看看是不是有新添加的文件跟之前文件同名

2,错误信息中出现了某个类的名字,去原文件中看看#import了哪些第三方库,把这些库挨个注释排除,找到出错的那个库,然后按照官方提供的步骤重新添加一遍。


除了以上原因:也有可能是->
原因4.也有可能是库文件没有导入进项目中

如:"Poco::SystemException::~SystemException()", referenced from:

      Poco::MutexImpl::lockImpl() in GameClient.o

Poco库没有导入到项目!




  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值