ARC Lite仅在Release配置中启用了第二代iPod上的应用程序崩溃 [英] ARC lite enabled app crashes on 2nd gen iPod only in Release configuration

查看:169
本文介绍了ARC Lite仅在Release配置中启用了第二代iPod上的应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个支持ARC lite的应用程序(启用了ARC而没有归零弱引用,Apple LLVM 4.0)。部署目标设置为iOS 4.0。它已经在iOS 4.0到5.1.1上进行了测试。当我使用调试版本并通过Xcode安装时,它总能正常工作,但是当我使用发布配置创建一个adhoc版本时,它总是会在使用iOS 4.2.1的第二代iPod上启动时崩溃,但在其他设备上工作正常(甚至第三代)带iOS 4.3的iPod。)

I have an ARC lite enabled app (ARC enabled without zeroing weak reference, Apple LLVM 4.0). Deployment target set to iOS 4.0. It's been tested on iOS 4.0 to 5.1.1. It always works fine when I use debug build and install through Xcode, but when I create an adhoc build with release configuration, it always crash during launch on 2nd gen iPod with iOS 4.2.1, but works fine on other devices (even 3rd gen iPod with iOS 4.3).

崩溃日志说找不到
符号:_objc_retainAutoreleasedReturnValue
当调用方法main时它会崩溃(然后是dyld_stub_binder ,dyld :: fastBindLazySymbol)

The crash log says symbol not found: _objc_retainAutoreleasedReturnValue and it crashes when method main is called (then it's dyld_stub_binder, dyld::fastBindLazySymbol)

我做了一些搜索,这个崩溃通常发生在没有弧的项目中包含启用弧的库时。但在我的情况下,整个项目都启用了弧。

I did some search and this crash normally happens when an arc enabled library is included in a project without arc. But in my case arc is enabled for the whole project.

任何线索?

非常感谢。

更新:我可以使用NSLog调试adhoc版本。

Update: I can use NSLog to debug the adhoc build.

main.m就像:

int main(int argc, char *argv[]) {
    NSLog(@"ok before entering autorelease pool");
    @autoreleasepool {
        NSLog(@"ok after entering autorelease pool");
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([XXX class]));
    }
}

NSLog(@输入自动释放池后确定)成功调用,但是应用程序:didFinishLaunchingWithOptions:永远不会输入。

NSLog(@"ok after entering autorelease pool") gets called successfully, but application:didFinishLaunchingWithOptions: is never entered.

推荐答案

它似乎与命令行构建工具有关。我曾经使用xcodebuild命令来存档adhoc构建:
xcodebuild -scheme myscheme clean build archive

It seems that it's related to the command line build tool. I used to use xcodebuild command to archive the adhoc build: xcodebuild -scheme myscheme clean build archive

并且崩溃了。

然后我尝试从Xcode归档,adhoc构建实际上在所有设备上都能正常工作。太奇怪了(请记住,adhoc命令行适用于比iPod 2nd更新的设备)。

Then I tried archiving from Xcode, the adhoc build actually works fine on all devices. So weird (keep in mind that the command line built adhoc worked for devices newer than iPod 2nd gen).

现在我只使用Xcode中的Archive按钮。但我在Apple开发论坛上发布了这个问题:
https://devforums.apple.com/message / 711334

For now I'll just use the Archive button in Xcode. But I posted this question in Apple dev forum: https://devforums.apple.com/message/711334

这篇关于ARC Lite仅在Release配置中启用了第二代iPod上的应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆