設置對了證書,但是一直報A valid provisioning profile for this executable was not found。于是進行了下面的操作。
*在Preferences中刪除開發者賬號和重新登錄。
*然后自然就想到點進Certificates,identifiers & profiles 里面了,選擇devices選擇相應的設備類型,這里我選擇all。然后進入,這里面有各種你這個賬號添加進來的設備,那些阿拉伯數字的就是xcode每次自己通過賬號添加進來的,而諸如有對應命名的,一般都是自己通過這個方法手動添加的。
*重啟Xcode,在/資源庫/MobileDevice/Provisioning Profiles/路徑下刪除.mobileprovision文件。
*刪除App,重新運行。
上面四種方法沒起作用。問題原因:Xcode8 在切換Team的時候,并沒有把project.pbxproj工程文件里的TeamID進行切換到新的TeamID。
解決辦法:找到變換前后兩個賬號的TeamID,這個可以到ituneconnect里面找,或者直接到project.pbxproj查找,出問題的此刻,已經存在兩個不同的teamID。登錄現在使用的開發者賬號,找到Team ID。
右擊工程名.xcodeproj選擇顯示包內容,打開project.pbxproj。找到DEVELOPMENT_TEAM,將所有的DEVELOPMENT_TEAM置為現在的teamID。
設置了證書,但是一直報The executable gets signed with invalid entitlements in Xcode。
問題原因及解決辦法:新建工程時在開發者配置項中和Xcode里面Capabilities文件打開的配置項不一致。到Xcode中Capabilities中將配置項調為和開發者中心新建App的配置項一致。
dismissViewController無效:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a presentation or dismiss is in progress!
在你使用presentModalViewController加載過多的視圖過程中,退出當前視圖[self dismissViewControllerAnimated:YEScompletion:nil];或者【self dismissViewControllerAnimated:NO completion:nil];使用如果遇到報這樣的警告且返回不到上個視圖。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];
}
*若方法一無效,則當前視圖在主線程還沒有加載出來,所以是釋放不了當前視圖的,解決方法二:dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self dismissViewControllerAnimated:NO completion:nil]; });
運行Xcode,一直顯示Running 1 of 1 custom shell scripts不動。
[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。
控制臺報錯:void SendDelegateMessage(NSInvocation*): delegate (webView:didFinishLoadForFrame:)failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode。
解決辦法:執行js代碼超過了10秒鐘,查找js代碼中的潛在錯誤。
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打包點擊Upload to App Store的時候報錯
Found an unexpected Mach-O header code: 0x72613c21
點擊show logs
did not contain a "archived-expanded-entitlements.xcent" resource
解決辦法:一個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和項目中SDK打包環境Xcode10.1不一致產生的,升級Xcode后再嘗試打包,Enable Bitcode設置為NO,終端打包命令添加ENABLE_BITCODE=No。
/Developer/SDKs/iPhoneOS10.1.sdk/usr/lib/libz.dylib (No such file or directory)
解決辦法:動態庫已經是.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'."
解決辦法:右擊 bundle 文件->顯示包文件,找到 info.plist 文件,有 Executable file 一行,刪除。
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.
解決辦法:把該報錯的可執行文件刪除。