美文网首页
Xcode 报错

Xcode 报错

作者: 码农的世界你不懂 | 来源:发表于2017-04-07 11:41 被阅读0次

```swift

The application could not be verified.

```

-  Xcode装机报错:"The application could not be verified."

+  删除之前在设备上安装的app就好了,估计问题应该是上一次的证书跟现在的证书不一致导致。

-  还有就是证书的问题,要么就是失效了,去https://developer.apple.com/membercenter/index.action进行重新生成

-  要么就是没有在Build Settings的Code Signing里面的Debug和Rlease里面设置iPhone Devolopment证书环境以及在Provisioning Profile中加上你的证书

-  崩溃报错:

```swift

[dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib]

```

-  解决方法:Try to do clean, build and then run the project. Worked for me.

-  先打一个全局断点,崩溃的时候,就能通过断点定位到哪里

-  今天不知道为什么Xib文件关联不上,不停的崩溃。报错:

```swift

[Fatal error: unexpectedly found nil while unwrapping an Optional values]

```

-  这里就发现昨天还可以编译运行的Xib文件(用作扫描二维码形式动画)今天就突然运行不了了

-  这里的代码失效了

```swift

/**

开始冲击线动画

*/

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()

})

}

```

-  错误定位在这里,我也不知道为什么突然就报错了

```swift

ScanLineTopCons.constant = -ContainerHeightCons.constant

```

-  **未解决**

-  #####可能崩溃原因:我的手机是iOS9.2的系统,测试机只有iOS8.4的系统。

在我的手机上可以正常跑起来,测试机上不可以。

-  1.找出动画总是崩溃的原因找出来

+  以解决。方案:

+  在Swift中,加载Xib需要加载(iOS9里面不用,不知道是不是个Bug)

+  FaceDetectViewController.swift和FaceDetectViewController.xib这里的Xib要在PhotoViewController.swift里面的signButtonClickAction()方法中加载一下

```swift

func signButtonClickAction(){

let detectViewController = FaceDetectViewController(nibName: "FaceDetectViewController", bundle: nil)

detectViewController.delegate = self

presentViewController(detectViewController, animated: true, completion: nil)

}

```

-  而且动画要在ViewDidAppear里面加载动画

```swift

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.

```swift

Could not find Developer Disk Image

```

-  这个报错是因为我的iOS系统升级成了9.3,而Xcode没有升级,所以报错

```swift

[Xcode 7.2 no matching provisioning profiles found]

```

-  解决办法

```swift

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.

```

相关文章

网友评论

      本文标题:Xcode 报错

      本文链接:https://www.haomeiwen.com/subject/bpkuhttx.html