Xcode 報(bào)錯(cuò)

```swift

The application could not be verified.

```

-? Xcode裝機(jī)報(bào)錯(cuò):"The application could not be verified."

+? 刪除之前在設(shè)備上安裝的app就好了,估計(jì)問(wèn)題應(yīng)該是上一次的證書(shū)跟現(xiàn)在的證書(shū)不一致導(dǎo)致。

-? 還有就是證書(shū)的問(wèn)題,要么就是失效了,去https://developer.apple.com/membercenter/index.action進(jìn)行重新生成

-? 要么就是沒(méi)有在Build Settings的Code Signing里面的Debug和Rlease里面設(shè)置iPhone Devolopment證書(shū)環(huán)境以及在Provisioning Profile中加上你的證書(shū)

-? 崩潰報(bào)錯(cuò):

```swift

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

```

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

-? 先打一個(gè)全局?jǐn)帱c(diǎn),崩潰的時(shí)候,就能通過(guò)斷點(diǎn)定位到哪里

-? 今天不知道為什么Xib文件關(guān)聯(lián)不上,不停的崩潰。報(bào)錯(cuò):

```swift

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

```

-? 這里就發(fā)現(xiàn)昨天還可以編譯運(yùn)行的Xib文件(用作掃描二維碼形式動(dòng)畫(huà))今天就突然運(yùn)行不了了

-? 這里的代碼失效了

```swift

/**

開(kāi)始沖擊線動(dòng)畫(huà)

*/

private func startAnimation()

{

// 1.初始化沖擊波位置

ScanLineTopCons.constant = -ContainerHeightCons.constant

view.layoutIfNeeded()

// 2.執(zhí)行動(dòng)畫(huà)

UIView.animateWithDuration(2.5, animations: { () -> Void in

// 告訴系統(tǒng)該動(dòng)畫(huà)需要重復(fù)

UIView.setAnimationRepeatCount(MAXFLOAT)

self.ScanLineTopCons.constant = self.ContainerHeightCons.constant

self.view.layoutIfNeeded()

})

}

```

-? 錯(cuò)誤定位在這里,我也不知道為什么突然就報(bào)錯(cuò)了

```swift

ScanLineTopCons.constant = -ContainerHeightCons.constant

```

-? **未解決**

-? #####可能崩潰原因:我的手機(jī)是iOS9.2的系統(tǒng),測(cè)試機(jī)只有iOS8.4的系統(tǒng)。

在我的手機(jī)上可以正常跑起來(lái),測(cè)試機(jī)上不可以。

-? 1.找出動(dòng)畫(huà)總是崩潰的原因找出來(lái)

+? 以解決。方案:

+? 在Swift中,加載Xib需要加載(iOS9里面不用,不知道是不是個(gè)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)

}

```

-? 而且動(dòng)畫(huà)要在ViewDidAppear里面加載動(dòng)畫(huà)




```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

```

-? 這個(gè)報(bào)錯(cuò)是因?yàn)槲业膇OS系統(tǒng)升級(jí)成了9.3,而Xcode沒(méi)有升級(jí),所以報(bào)錯(cuò)


```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.

```

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,872評(píng)論 0 10
  • 一般在程序中先打一個(gè)全局?jǐn)帱c(diǎn),崩潰的時(shí)候,一般就能通過(guò)斷點(diǎn)定位到在哪里 1: Xcode裝機(jī)報(bào)錯(cuò):"The app...
    Tuberose閱讀 1,507評(píng)論 7 17
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的閱讀 13,675評(píng)論 5 6
  • “ 人的精神世界好比一座冰山,清醒意識(shí)只占了其中浮出水面的那一小部分,在水面底下隱秘的大部分是潛意識(shí),潛意識(shí)里面的...
    覺(jué)知中的帆閱讀 290評(píng)論 0 0
  • 我是一名211院校工科研究生,目前研二。作為一名研究生,我們期待通過(guò)自己3年的學(xué)習(xí),專業(yè)技能與本科生相比有跨越式的...
    possible先生閱讀 892評(píng)論 0 7

友情鏈接更多精彩內(nèi)容