[英]iOS App Crash On Launch With Only LLDB() (The App Works In Simulator)
Just finished updating codebase to Swift 4. It is working fine in the simulator. 刚刚完成了将代码库更新到Swift 4的工作。在模拟器中,它工作正常。 When I build to a device I get an instant crash with no error message:
构建设备时,我会立即崩溃,没有错误消息:
It works fine in the simulator. 它在模拟器中工作正常。
There are some threads on it: 上面有一些线程:
App crashes only with (lldb)? 应用仅因(lldb)而崩溃?
iOS app crashes with no error, just (lldb) iOS应用程序崩溃,没有错误,仅(lldb)
dyld`__abort_with_payload: With no error message dyld`__abort_with_payload:没有错误消息
From what I learned the problem might be linked binaries but I've dug into my linked binaries and I believe everything is linked correctly. 从我学到的问题可能是链接的二进制文件,但是我已经研究了链接的二进制文件,并且我相信一切都正确地链接了。
Any thoughts on where to begin debugging this or what the problem might be? 关于从哪里开始调试此问题或可能是什么问题的任何想法?
Update1: I had an internal framework for one of my xcodeproj's so I tried removing it and installing it as a pod but the error still persists. 更新1:我有一个内部框架用于我的xcodeproj,所以我尝试将其删除并将其安装为Pod,但错误仍然存在。
Update2 Adding full stack trace: Update2添加完整的堆栈跟踪:
Update3 Error trace from forcing crash by launching app not from Xcode but the phone itself and then tracing error log: Termination Description: DYLD, Library not loaded: @rpath/PromiseKit.framework/PromiseKit | Referenced from: /var/containers/Bundle/Application/C50A937F-2A6F-4E5C-89C7-2D
Update3错误跟踪,它不是通过从Xcode启动应用程序而是从手机本身启动应用程序,然后通过跟踪错误日志来强制崩溃:
Termination Description: DYLD, Library not loaded: @rpath/PromiseKit.framework/PromiseKit | Referenced from: /var/containers/Bundle/Application/C50A937F-2A6F-4E5C-89C7-2D
Termination Description: DYLD, Library not loaded: @rpath/PromiseKit.framework/PromiseKit | Referenced from: /var/containers/Bundle/Application/C50A937F-2A6F-4E5C-89C7-2D
Update4 After removing the promisekit framework the shell version of the app does compile on the device which leads me to conclude this (like the others who have had this mysterious issue) is a framework link error. UPDATE4去除promisekit框架应用程序的外壳版本没有这使我得出结论这(喜欢谁都有过这种神秘的问题等)的设备上进行编译后是一个框架链接错误。 However trying all the solutions in the common threads like:
但是,请尝试使用通用线程中的所有解决方案,例如:
iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta 带有框架的iOS应用在设备上崩溃,dyld:库未加载,Xcode 6 Beta
Has not worked. 没用。 Embedding and linking or anything else has not worked.
嵌入和链接或其他任何方法均无效。
So it is a framework linking error of some kind but linking and embedding does not seem to fix the issue. 因此,这是一个框架链接错误,但链接和嵌入似乎无法解决该问题。
One of the things that can trip up development with the simulator is its access to Macintosh resources. 可以使模拟器无法进行开发的一件事是它可以访问Macintosh资源。 The project may have accidentally been linked to a Macintosh version of a framework or library.
该项目可能不小心链接到Macintosh版本的框架或库。 It exists on the simulator, but does not exist on an iPhone device.
它存在于模拟器中,但不存在于iPhone设备上。
I have had issues in the past with Xcode choosing the wrong version of a framework when the targets for iOS and Mac had the same names. 过去,当iOS和Mac的目标名称相同时,Xcode选择了错误版本的框架时遇到了问题。 If you have such frameworks, try changing one or both target names and product names temporarily.
如果您有这样的框架,请尝试暂时更改目标名称和产品名称中的一个或两个。 Then see if Xcode is choosing the one you intended.
然后查看Xcode是否正在选择您想要的那个。
The long and the short of it was when I embedded the framework into the main app, it caused some other obscure bug. 总而言之,当我将框架嵌入主应用程序时,它引起了其他一些难以理解的错误。 When I removed a runscript from the build phases, it allowed the embedding to actually work and it fixed the issue.
当我从构建阶段删除运行脚本时,它允许嵌入实际运行,并解决了该问题。
So by deleting the run script phase seen below in the build phases: 因此,通过删除以下在构建阶段中看到的运行脚本阶段:
I was able to embed the framework and the app began to compile on devices. 我能够嵌入框架,并且该应用开始在设备上编译。
So if you have this type of error in the future the solution is still to embed it, but in my case, there was another problem preventing that embedding from working. 因此,如果将来出现此类错误,则解决方案仍然是嵌入它,但就我而言,还有另一个问题使嵌入无法正常工作。
After I solved another problem: https://stackoverflow.com/a/48538124/1012775 I modified some settings that kind of messed up my build settings. 解决了另一个问题后: https : //stackoverflow.com/a/48538124/1012775我修改了一些设置,这些设置弄乱了我的构建设置。 Because of that I got the same problem as the questioner here.
因此,我遇到了与提问者相同的问题。
I solved it by doing a 'git reset --hard' and got back to my clean state. 我通过执行“ git reset --hard”解决了该问题,并恢复到干净的状态。 Since than I don't have this issue anymore, thank God.
由于我已经没有这个问题了,感谢上帝。 It might work for you too.
它也可能对您有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.