【问题标题】:App works on iPhone 3GS but crashes on iPhone 3G at launch应用程序可在 iPhone 3GS 上运行,但在启动时在 iPhone 3G 上崩溃
【发布时间】:2010-06-23 02:53:17
【问题描述】:

我使用 Xcode 3.2.3 和 iPhone SDK 4.0 开发了一个应用程序。如果我直接在 Xcode 中运行它,它在 iPhone 3GS 和 3G 上都可以正常工作。

但是,如果我从 App Store 下载并安装该应用程序,它会在 iPhone 3G 和 iPod touch 3G 的启动屏幕上崩溃。但它适用于 OS 3.1.3 或 iOS 4.0 的 iPhone 3GS。

设备日志显示如下:

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x00000001, 0x00000000

Crashed Thread:  0    

Thread 0 Crashed:
0   Dove                0x000762aa +[TTNavigator navigator] (TTNavigator.m:59)
1   Dove                0x000035ce -[Around01AppDelegate applicationDidFinishLaunching:] (Around01AppDelegate.m:85)
2   UIKit               0x00004e88 -[UIApplication _performInitializationWithURL:sourceBundleID:] + 540
3   UIKit               0x00004a60 -[UIApplication _runWithURL:sourceBundleID:] + 576
4   UIKit               0x00055df8 -[UIApplication handleEvent:withNewEvent:] + 1516
5   UIKit               0x00055634 -[UIApplication sendEvent:] + 60
6   UIKit               0x0005508c _UIApplicationHandleEvent + 4528
7   GraphicsServices    0x00005988 PurpleEventCallback + 1044
8   CoreFoundation      0x00057524 CFRunLoopRunSpecific + 2296
9   CoreFoundation      0x00056c18 CFRunLoopRunInMode + 44
10  UIKit               0x00003c00 -[UIApplication _run] + 512
11  UIKit               0x00002228 UIApplicationMain + 960
12  Dove                0x00003086 main (main.m:26)
13  Dove                0x00002ec8 start + 44

【问题讨论】:

    标签: ios crash


    【解决方案1】:

    您的发布配置中有错误的架构设置。如果要在 3G 和 2008 iPod touch 上部署,则必须为 arm6 和 arm7 创建指令。您可能只是在创建优化的 arm7 二进制文件。将 arm6 架构添加到您的发布配置中,然后重试。

    【讨论】:

    • 嗨,杰森,感谢您的帮助!这是我的项目设置:架构:标准(armv6 armv7),基础 SDK:iPhone 设备 4.0,仅构建活动架构:(选中),有效架构:armv6 armv7。这些是我应该做的正确设置吗?当我使用 xCode 运行该应用程序时,它在 3G 上运行良好。谢谢!
    • 我通过参考此页面上的信息弄清楚了:useyourloaf.com/blog/2010/4/21/… 稍后将提交一个新的二进制文件,看看它是如何进行的。谢谢!
    • @noear:哦,很好,我很高兴你知道了。您应该使用该链接作为实际答案回答您的问题并接受它,这样搜索类似内容的人可以快速找到解决方案:)
    【解决方案2】:

    我通过参考此页面上的信息弄清楚了:http://useyourloaf.com/blog/2010/4/21/xcode-build-active-architecture-only.html

    如果您使用任何第三方库,应使用与您在自己的项目中使用的相同的项目设置重新编译所有这些库。

    就我而言, 基础 SDK:iOS 4.0, 部署目标:3.0, 并确保取消选中“仅构建活动架构”

    【讨论】:

    • +1 指出第三方库可能导致这种情况发生。
    【解决方案3】:

    启动崩溃是由于依赖项和项目的架构错误造成的。我的项目也有类似的问题。我的项目在 Debug iPhone 3G 上运行良好,并在 Release iPhone 3G 上崩溃。但是,它在 iPad 和 iPhone 4 的 Debug/Release 中运行良好。

    我有一个使用 Debug(标准 armv6、armv7)和 Release(优化 armv7)构建的库。主要项目是使用标准(armv6,armv7)进行调试/发布。这种架构不匹配导致了 iPhone 3G 上的 Release 崩溃。我出现这个崩溃的原因是 iPhone 3G 必须使用 armv6,但 iPhone 4 和 iPad 可以使用 armv7。

    run
    Running…
    [Switching to thread 11523]
    [Switching to thread 11523]
    sharedlibrary apply-load-rules all
    continue
    Program received signal:  “EXC_BAD_ACCESS”.
    warning: check_safe_call: could not restore current frame
    
    warning: Unable to restore previously selected frame.
    warning: Unable to restore previously selected frame.
    warning: Unable to restore previously selected frame.
    warning: Unable to restore previously selected frame.
    warning: Unable to restore previously selected frame.
    (gdb) 
    

    要解决此问题,请将 iPhone 库 Target 的“架构”更改为“所有配置”使用标准(armv6、armv7)。

    【讨论】:

      【解决方案4】:

      嘿,您提到了使用 Facebook three20 库。我们遇到了完全相同的问题 - 应用程序仅在 appstore 分发中使用 EXC_BAD_ACCESS 崩溃 |发布配置,仅在 iPhone 3G / iPod touch 2G 上,但在 iPhone 3GS 和 iPad 上完美运行。事实证明,我们使用的是内置于 three20 的 JSON 库,而那个库就是原因。在我们的案例中,通过下载新版本的 JSON 库(显然已修复此错误)解决了问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-01-15
        • 1970-01-01
        • 1970-01-01
        • 2011-09-15
        • 1970-01-01
        • 1970-01-01
        • 2011-03-14
        • 2012-05-08
        相关资源
        最近更新 更多