[英]App crash on device but works on simulator iOS
App wasn't developed by me, but now I have to add some features.应用程序不是我开发的,但现在我必须添加一些功能。 Code compiles add launches on simulator but immediately crash on real device (didFinishLaunchingWithOptions never calls).
代码编译添加在模拟器上启动,但在真实设备上立即崩溃(didFinishLaunchingWithOptions 从不调用)。 Xcode doesn't show any errors.
Xcode 没有显示任何错误。 I think the problem may be in pods and frameworks but don't know how to check if this so.
我认为问题可能出在 pod 和框架中,但不知道如何检查是否如此。 I reinstalled pods and recreated framework dependences in project but no app still crash.
我在项目中重新安装了 pod 并重新创建了框架依赖项,但没有应用程序仍然崩溃。 I have only this info from Xcode
我只有来自 Xcode 的这个信息
How this info can help me?这些信息如何帮助我? Any help appreciated.
任何帮助表示赞赏。
UPD2: App crash on iOS9 and iOS10 so NSCameraUsageDescription isn't the problem UPD2:iOS9 和 iOS10 上的应用程序崩溃,因此 NSCameraUsageDescription 不是问题
had the same problem, worked on simulator but not on device and got this wonderful but minimalist stacktrace "abort_with_payload"有同样的问题,在模拟器上工作但不在设备上工作,得到了这个美妙但极简的堆栈跟踪“abort_with_payload”
Turns out I just needed the "NSMicrophoneUsageDescription" key in my plist结果我只需要 plist 中的“NSMicrophoneUsageDescription”键
The problem was in pods frameworks.问题出在 pods 框架中。 Script generated by pods can't embed some frameworks correctly.
Pod 生成的脚本无法正确嵌入某些框架。 I removed "[CP] Embed Pods Frameworks" script and add frameworks to "Embedded Binaries" by myself.
我删除了“[CP] Embed Pods Frameworks”脚本,并自己将框架添加到“Embedded Binaries”。 And problem was solved.
问题解决了。
如果发生abort_with_payload
错误,则 Info.plist 可能缺少任何隐私密钥的UsageDescription
,因此请检查是否缺少任何内容或苹果更改/添加了您正在使用的相机、照片、位置等的新 UsageDescription。
Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Description: DYLD, Library not loaded: @rpath/libswiftCoreGraphics.dylib | Referenced from: /var/containers/Bundle/Application/7208AD66-5D56-4973-88A9-8D22D7E541DB/myapp.app/myapp | Reason: no suitable image found. Did find: | /private/var/containers/Bundle/Application/7208AD66-5D56-4973-88A9-8D22D7E541DB/myapp.app/Frameworks/libswiftCoreGraphics.dylib: code signing blocked mmap() '/private/var/containers/Bundle/Application/7208AD66-5D56-4973-88A9-8D22D7E541DB/myapp.app/Frameworks/libswiftCoreGraphics.dylib'
When crashed on 'abort_with_payload', I also got the above output from the console.当在“abort_with_payload”上崩溃时,我也从控制台获得了上述输出。 I think the most important message is "code signing blocked mmap()", which indicates the problem was probably caused by code signing.
我认为最重要的消息是“代码签名被阻止的 mmap()”,这表明问题可能是由代码签名引起的。
My solution was to delete the apple WWDR certificate and downloaded it from Apple.我的解决方案是删除苹果WWDR证书并从Apple下载。 And MAKE SURE when trusting the certificate, use the "use system defaults" option.
并确保在信任证书时,使用“使用系统默认值”选项。
Then QUIT the XCode, reopened it, cleaned the project and rebuilt.然后退出 XCode,重新打开它,清理项目并重建。 It works for me.
它对我有用。
This can also happen when you have XIB's in a subproject, and they have embedded UIViews.当您在子项目中有 XIB 并且它们嵌入了 UIViews 时,也会发生这种情况。 These UIViews should then have the right module selected!
这些 UIViews 然后应该选择正确的模块!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.