iOS常见报错

设置对了证书,但是一直报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。
iOS常见报错
文章图片
WX20181018-173212@2x.png 右击工程名.xcodeproj选择显示包内容,打开project.pbxproj。找到DEVELOPMENT_TEAM,将所有的DEVELOPMENT_TEAM置为现在的teamID。
iOS常见报错
文章图片
WX20181018-175227@2x.png 设置了证书,但是一直报The executable gets signed with invalid entitlements in Xcode。
问题原因及解决办法:新建工程时在开发者配置项中和Xcode里面Capabilities文件打开的配置项不一致。到Xcode中Capabilities中将配置项调为和开发者中心新建App的配置项一致。
iOS常见报错
文章图片
WX20181018-180916@2x.png
iOS常见报错
文章图片
1539857414974.jpg dismissViewController无效:Warning: Attempt to dismiss from view controller 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 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。

iOS常见报错
文章图片
WX20181022-181033@2x.png 控制台报错: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的时候报错
iOS常见报错
文章图片
VaRZnA.png
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'."
iOS常见报错
文章图片
0.png 解决办法:右击 bundle 文件->显示包文件,找到 info.plist 文件,有 Executable file 一行,删除。

iOS常见报错
文章图片
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.
【iOS常见报错】解决办法:把该报错的可执行文件删除。

iOS常见报错
文章图片
2.png

    推荐阅读