iOS常見報(bào)錯(cuò)

設(shè)置對(duì)了證書,但是一直報(bào)A valid provisioning profile for this executable was not found。于是進(jìn)行了下面的操作。

*在Preferences中刪除開發(fā)者賬號(hào)和重新登錄。
*然后自然就想到點(diǎn)進(jìn)Certificates,identifiers & profiles 里面了,選擇devices選擇相應(yīng)的設(shè)備類型,這里我選擇all。然后進(jìn)入,這里面有各種你這個(gè)賬號(hào)添加進(jìn)來的設(shè)備,那些阿拉伯?dāng)?shù)字的就是xcode每次自己通過賬號(hào)添加進(jìn)來的,而諸如有對(duì)應(yīng)命名的,一般都是自己通過這個(gè)方法手動(dòng)添加的。
*重啟Xcode,在/資源庫(kù)/MobileDevice/Provisioning Profiles/路徑下刪除.mobileprovision文件。
*刪除App,重新運(yùn)行。

上面四種方法沒起作用。問題原因:Xcode8 在切換Team的時(shí)候,并沒有把project.pbxproj工程文件里的TeamID進(jìn)行切換到新的TeamID。

解決辦法:找到變換前后兩個(gè)賬號(hào)的TeamID,這個(gè)可以到ituneconnect里面找,或者直接到project.pbxproj查找,出問題的此刻,已經(jīng)存在兩個(gè)不同的teamID。登錄現(xiàn)在使用的開發(fā)者賬號(hào),找到Team ID。

WX20181018-173212@2x.png

右擊工程名.xcodeproj選擇顯示包內(nèi)容,打開project.pbxproj。找到DEVELOPMENT_TEAM,將所有的DEVELOPMENT_TEAM置為現(xiàn)在的teamID。

WX20181018-175227@2x.png

設(shè)置了證書,但是一直報(bào)The executable gets signed with invalid entitlements in Xcode。

問題原因及解決辦法:新建工程時(shí)在開發(fā)者配置項(xiàng)中和Xcode里面Capabilities文件打開的配置項(xiàng)不一致。到Xcode中Capabilities中將配置項(xiàng)調(diào)為和開發(fā)者中心新建App的配置項(xiàng)一致。

WX20181018-180916@2x.png

1539857414974.jpg

dismissViewController無效:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a presentation or dismiss is in progress!

在你使用presentModalViewController加載過多的視圖過程中,退出當(dāng)前視圖[self dismissViewControllerAnimated:YEScompletion:nil];或者【self dismissViewControllerAnimated:NO completion:nil];使用如果遇到報(bào)這樣的警告且返回不到上個(gè)視圖。Warning: Attempt to dismiss from view controller <xxxxxViewController: 0x13f6840e0> while a presentation or dismiss is in progress!


*解決方法一:if (![self.presentedViewController isBeingDismissed]) {
[self dismissViewControllerAnimated:YES completion:nil];
}

*若方法一無效,則當(dāng)前視圖在主線程還沒有加載出來,所以是釋放不了當(dāng)前視圖的,解決方法二:dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:NO completion:nil]; });

運(yùn)行Xcode,一直顯示Running 1 of 1 custom shell scripts不動(dòng)。

[Build][iOS] Building project in Xcode takes for ever in Running 1 of 1 custom shell scripts。

解決辦法:在Xcode里面Build Phases里面勾選Run script only when installing。


WX20181022-181033@2x.png

控制臺(tái)報(bào)錯(cuò):void SendDelegateMessage(NSInvocation*): delegate (webView:didFinishLoadForFrame:)failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode。

解決辦法:執(zhí)行js代碼超過了10秒鐘,查找js代碼中的潛在錯(cuò)誤。

JavaScript execution time is limited to 10 seconds for each top-level entry point. If your script executes for more than 10 seconds, the web view stops executing the script

Xcode打包點(diǎn)擊Upload to App Store的時(shí)候報(bào)錯(cuò)

VaRZnA.png
Found an unexpected Mach-O header code: 0x72613c21
點(diǎn)擊show logs
did not contain a "archived-expanded-entitlements.xcent" resource

解決辦法:一個(gè)static的libraryxxx.framework被添加在Embedded Binaries里面了,從Embedded Binaries移除framework,添加在Link Frameworks and Libraries里面。

'Invalid bitcode version (Producer: '')', using libLTO version 'LLVM version 10.0.0

解決辦法:由于本地Xcode版本10.2.1和項(xiàng)目中SDK打包環(huán)境Xcode10.1不一致產(chǎn)生的,升級(jí)Xcode后再嘗試打包,Enable Bitcode設(shè)置為NO,終端打包命令添加ENABLE_BITCODE=No。

/Developer/SDKs/iPhoneOS10.1.sdk/usr/lib/libz.dylib (No such file or directory)

解決辦法:動(dòng)態(tài)庫(kù)已經(jīng)是.tbd了,直接刪了工程里的libz.dylib,添加libz.tbd。

ERROR ITMS-90166: "Missing Code Signing Entitlements. No entitlements found in bundle 'com...' for executable 'Payload/xxxx.app/xxxx.bundle/xxxBundle'."

0.png

解決辦法:右擊 bundle 文件->顯示包文件,找到 info.plist 文件,有 Executable file 一行,刪除。


1.png

ERROR ITMS-90171:Invalid Bundle Structure - The binary file 'xxxx.app/xxxx.bundle/xxxxBundle' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure.

解決辦法:把該報(bào)錯(cuò)的可執(zhí)行文件刪除。


2.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容