简体   繁体   English

应用程序在设备上崩溃但在模拟器 iOS 上工作

[英]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.任何帮助表示赞赏。

UPD1: stacktrace UPD1:堆栈跟踪在此处输入图片说明

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.

相关问题 iOS应用程序崩溃-但不在模拟器中-硬编码网址有效 - IOS app crash - but not in simulator - hardcoding URL works Xcode 5和iOS 7模拟器/设备崩溃并出现僵尸错误-适用于iOS6 - Xcode 5 and iOS 7 Simulator/Device Crash with zombie error - Works on iOS6 iOS应用程序在模拟器中以后台模式工作,但在设备中不工作吗? - iOS app works in background mode in simulator but not in device? iOS-应用程式可在装置上运作,但无法在模拟器上运作(不再) - iOS - app works on device but not on simulator (anymore) iOS应用可在模拟器上运行,但不能在真实设备上运行 - iOS app works on simulator but not on real device UICollectionView-iOS 10-在iPhone 6 Plus模拟器上崩溃但可在真实设备上运行 - UICollectionView - iOS 10 - crash on iPhone 6 Plus simulator but works on real device 仅使用LLDB()启动时iOS应用程序崩溃(该应用程序在模拟器中运行) - iOS App Crash On Launch With Only LLDB() (The App Works In Simulator) 应用程序适用于模拟器但不适用于设备 - App works on simulator but not on device Flutter 应用程序在启动时崩溃(仅 IOS,模拟器和真机都有) - Flutter app crash on startup (only IOS, both simulator and real device) 在iOS模拟器上可以使用,但在iOS设备上不能使用吗? - Works on iOS Simulator but not on iOS device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM