App crash on device but works on simulator iOS

倖福魔咒の 提交于 2019-12-03 13:06:33

had the same problem, worked on simulator but not on device and got this wonderful but minimalist stacktrace "abort_with_payload"

Turns out I just needed the "NSMicrophoneUsageDescription" key in my plist

The problem was in pods frameworks. Script generated by pods can't embed some frameworks correctly. I removed "[CP] Embed Pods Frameworks" script and add frameworks to "Embedded Binaries" by myself. And problem was solved.

If abort_with_payload error occurred then chances are the Info.plist is missing UsageDescription of any Privacy key so check is there any thing missing or apple changed/added new UsageDescription for camera, photos, location etc that you are using.

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. I think the most important message is "code signing blocked mmap()", which indicates the problem was probably caused by code signing.

My solution was to delete the apple WWDR certificate and downloaded it from 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. It works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!