简体   繁体   中英

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). Xcode doesn't show any errors. I think the problem may be in pods and frameworks but don't know how to check if this so. I reinstalled pods and recreated framework dependences in project but no app still crash. I have only this info from Xcode在此处输入图片说明 在此处输入图片说明

How this info can help me? Any help appreciated.

UPD1: stacktrace 在此处输入图片说明

UPD2: App crash on iOS9 and iOS10 so NSCameraUsageDescription isn't the problem

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.

如果发生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. 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.

This can also happen when you have XIB's in a subproject, and they have embedded UIViews. These UIViews should then have the right module selected!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM