该应用程序适用于iPhone 3GS,但在发布时会在iPhone 3G上崩溃

时间:2010-06-23 02:53:18

标签: ios crash

我使用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

4 个答案:

答案 0 :(得分:2)

您的版本配置中的架构设置错误。如果要部署在3G和2008 iPod touch上,则必须为arm6和arm7创建说明。您可能只是创建一个优化的arm7二进制文件。将arm6体系结构添加到Release配置中,然后重试。

答案 1 :(得分:2)

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

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

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

答案 2 :(得分:1)

启动崩溃是依赖项和项目的错误架构的结果。我的项目遇到了类似的问题。我的项目在Debug iPhone 3G上正常运行,并且崩溃了iPhone 3G。但是,它在Debug和Release中的iPad和iPhone 4上运行良好。

我有一个用Debug(标准armv6,armv7)和Release(优化armv7)构建的库。主要项目是使用Standard(armv6,armv7)进行调试/发布。这种架构不匹配导致iPhone 3G上的版本崩溃。我遇到这次崩溃的原因是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)进行“所有配置”。

答案 3 :(得分:0)

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