Xcode 报错
2016-04-26 本文已影响856人
Tuberose
一般在程序中先打一个全局断点,崩溃的时候,一般就能通过断点定位到在哪里
1:
The application could not be verified.
- Xcode装机报错:"The application could not be verified."
- 删除之前在设备上安装的app就好了,估计问题应该是上一次的证书跟现在的证书不一致导致。
- 还有要么就是证书的问题,要么就是失效了,去https://developer.apple.com/membercenter 进行重新生成
- 要么就是没有在Build Settings的Code Signing里面的Debug和Rlease里面设置iPhone Devolopment证书环境以及在Provisioning Profile中加上你的证书
2
- 崩溃报错:
[dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib]
- 解决方法:Try to do clean, build and then run the project. Worked for me.
- clean后重新编译,然后再运行
3
- 今天不知道为什么Xib文件关联不上,不停的崩溃。报错:
[Fatal error: unexpectedly found nil while unwrapping an Optional values]
- 这里就发现昨天还可以编译运行的Xib文件(用作扫描二维码形式动画)今天就突然运行不了了
- 这里的代码失效了
/**
开始冲击线动画
*/
private func startAnimation()
{
// 1.初始化冲击波位置
ScanLineTopCons.constant = -ContainerHeightCons.constant
view.layoutIfNeeded()
// 2.执行动画
UIView.animateWithDuration(2.5, animations: { () -> Void in
// 告诉系统该动画需要重复
UIView.setAnimationRepeatCount(MAXFLOAT)
self.ScanLineTopCons.constant = self.ContainerHeightCons.constant
self.view.layoutIfNeeded()
})
}
- 错误定位在这里,我也不知道为什么突然就报错了
ScanLineTopCons.constant = -ContainerHeightCons.constant
- 未解决
- 可能崩溃原因:我的手机是iOS9.2的系统,测试机只有iOS8.4的系统。在我的手机上可以正常跑起来,测试机上不可以。
- 找出动画总是崩溃的原因
- 已解决。方案:
- Swift中,Xib需要加载(iOS9里面不用,不知道是不是个Bug,还是别的原因)
- FaceDetectViewController.swift和FaceDetectViewController.xib这里的Xib要在PhotoViewController.swift里面的signButtonClickAction()方法中加载一下
func signButtonClickAction(){
let detectViewController = FaceDetectViewController(nibName: "FaceDetectViewController", bundle: nil)
detectViewController.delegate = self
presentViewController(detectViewController, animated: true, completion: nil)
}
- 而且动画要在ViewDidAppear里面加载动画
4
This application's application-identifier entitlement does not match that of the installed application.
These values must match for an upgrade to be allowed.
- iPhone上已经安装了包标识符一样的 App,你可以删除后再运行。
5
Could not find Developer Disk Image
- 这个报错是因为我的iOS系统升级成了9.3,而我的Xcode没有升级,所以报错
- 今后如果我们升级了最新的iOS系统,如果你用它测试,就需要将你的Xcode也进行相应的升级了(苹果一般iOS系统升级和Xcode升级同时进行吧?)
6
[Xcode 7.2 no matching provisioning profiles found]
- 解决办法
I also had some problems after updating Xcode.
I fixed it by opening Xcode Preferences (⌘+,), going to *Accounts* → *View Details*. Then select all provisioning profiles and delete them with backspace. Restart Xcode, else the list doesn't seem to update properly.
Now click the *Download all* button, and you should have all provisioning profiles that you defined in the Member center back in Xcode. Don't worry about the Xcode-generated ones (Prefixed with XC:
), Xcode will regenerate them if necessary.
Now go to the *Code Signing* section in your Build Settings and select the correct profile and cert. If necessary, restart Xcode again.
Why this happens at all? No idea... I gave up on understanding Apple's policies regarding app signing.
- 这种问题我觉得是你对应的开发证书没有添加进去,没有匹配的证书
- 还有一种情况就是:你用了新的测试机。你没有把它的UDID添加到账号中去
- 我们在开发的时候如果是用的个人账号,你用一台新的测试机运行,对应的证书是不匹配的,你需要到开发中中心去在对应证书中将测试机的UDID添加进去。每次都要重新添加一次
7
The model used to open the store is incompatible with the one used to create the store
- 解决方法
- Remove the app from the simulator and perform a clean on your project. That should clear those issues up. Make sure that you are not running in the debugger when you delete the app or else it won't actually delete it properly.
- If you want to be sure its gone, check this directory Users/INSERT_YOUR_USER_HERE/Library/Application Support/iPhone Simulator/
for your app's folder, under the version you're running. - Note: This is for development only. For production, you need to implement some sort of migration. Google "Core Data Migration", with lightweight migration being the simplest.
- 这是使用Core Data的时候遇上的问题。先将模拟器或者测试机上运行的程序删除,再运行
- 但是StackOverFlow上的答者已经告诉我了,需要做一个轻量级的Core Data 迁移,才能彻底解决问题,我当时只看了第一个建议就以为解决问题了,但是没有仔细继续阅读导致在今天进行总结的时候才发现,一月前就已经给我提供了解决方案和方向,我自己却遗失了
- 所以这里很重要的是在遇上别人对你搜索的相关问题进行详细解答的时候一定要认真看完,不要一知半解,错过了对你APP更重要的解决知识