【问题标题】:Unable to run iOS 3.X app compiled with iOS SDK 4.3无法运行使用 iOS SDK 4.3 编译的 iOS 3.X 应用程序
【发布时间】:2011-04-08 03:36:15
【问题描述】:

我最近升级到 xCode 4.0.1 以使用最新的 iOS SDK (4.3)。我目前正在开发 iOS 3.X 设备,但希望在不久的将来扩展到 iOS 4.X。

问题是,我似乎无法在我当前的 3.X 设备上成功运行任何东西。据我了解,4.3 SDK 支持编译到所有版本的 iOS 3.0 及后续版本,当然我可以编译这样的应用程序就好了。但如果我尝试在模拟器或设备上运行它,它会开始加载然后崩溃。

现在我只是试图让默认的基于窗口的应用程序在没有任何修改的情况下运行。我选择了 4.3 作为基础 SDK,并将我的部署目标设置为 3.0。我可以选择从 3.0 开始的所有 iOS 版本作为我的构建目标,但实际上只使用 4.3 似乎完全可行。

当我在手机上运行应用程序时,我会在日志中看到以下内容:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:56:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002
warning: Unable to read symbols from "dyld" (prefix __dyld_) (not yet mapped into memory).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/Frameworks/UIKit.framework/UIKit (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols from "Foundation" (not yet mapped into memory).
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.1.3 (7E18)/Symbols/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
warning: Unable to read symbols from "libgcc_s.1.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libSystem.B.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libobjc.A.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "CoreFoundation" (not yet mapped into memory).
target remote-mobile /tmp/.XcodeGDBRemote-18423-39
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 11779 thread 0x0]
[Switching to process 11779 thread 0x0]
gdb stack crawl at point of internal error:
0   gdb-arm-apple-darwin                0x000000010010974a internal_vproblem + 308
1   gdb-arm-apple-darwin                0x0000000100109924 internal_verror + 27
2   gdb-arm-apple-darwin                0x00000001001099c2 align_down + 0
3   gdb-arm-apple-darwin                0x0000000100150c5e macosx_solib_add + 794
4   gdb-arm-apple-darwin                0x000000010016417c remote_macosx_complete_create_or_attach + 187
5   gdb-arm-apple-darwin                0x000000010016489e remote_macosx_create_inferior + 1252
6   gdb-arm-apple-darwin                0x000000010005f6c3 run_command_1 + 586
7   gdb-arm-apple-darwin                0x0000000100107b7f execute_command + 557
8   gdb-arm-apple-darwin                0x00000001000171e7 mi_execute_async_cli_command + 204
9   gdb-arm-apple-darwin                0x00000001000168e5 captured_mi_execute_command + 344
10  gdb-arm-apple-darwin                0x0000000100072a62 catch_exception + 57
11  gdb-arm-apple-darwin                0x000000010001443e mi_execute_command + 140
12  gdb-arm-apple-darwin                0x0000000100077721 process_event + 133
13  gdb-arm-apple-darwin                0x0000000100078435 gdb_do_one_event + 1049
14  gdb-arm-apple-darwin                0x0000000100072b49 catch_errors + 70
/SourceCache/gdb/gdb-1518/src/gdb/macosx/macosx-nat-dyld.c:1648: internal-error: unrecognized shared library breakpoint
A problem internal to GDB has been detected,
further debugging may prove unreliable.

我猜在某个地方,应用程序没有正确设置以链接到 3.X 版本的 API,因此日志中出现“无法读取符号”的内容。我只是似乎无法弄清楚如何纠正这种情况。

任何建议都非常感谢!

【问题讨论】:

    标签: ios ios4 xcode4 ios3.0


    【解决方案1】:

    没有“3.x API 的链接”,只有您使用的 SDK。 SDK 向后兼容,以便在 3.x 设备上正常运行。

    仔细检查您在 xcodeproj 级别目标级别的设置是否正确。如果所有这些事情都是正确的,那么它应该可以在 3.1 设备上正常工作。

    如果这不起作用,那么这里有一些黑暗中的镜头可能会有所帮助:

    • 重启 Mac iPhone 3.x 设备
    • 删除并重新添加必要的配置文件
    • 仔细检查您的证书是否有效
    • 确保调试版本的项目和目标设置中没有授权文件
    • 清除所有目标
    • 再次构建并运行

    如果这些都不起作用,您可能安装的 Xcode 4 已损坏。

    希望这会有所帮助:)

    【讨论】:

    • 感谢您的建议。看起来它最终可能是配置文件 - 只是为了好玩,我尝试了一部全新的手机,看看它是否可以工作(这当然需要更新配置文件),并且它有效。再次感谢!
    【解决方案2】:

    您是否将 iOS 3.x 指定为目标?如果您将构建目标设置为最新版本 (4.3),则需要该版本。

    【讨论】:

    • 是的,试过了。我已经尝试将我的构建目标设置为从 3.0 到 4.3 的每个版本,并且只有 4.3 可以工作(然后,因为我有一部 3.1.3 手机,所以只能在模拟器上使用)。
    • 我唯一的选择是“iPhone”、“iPhone (Retina)”和“iPad”。我一直在使用“iPhone”进行测试。
    • 抱歉,我星期五一定是半睡半醒——在模拟器中,在硬件菜单下一个版本子菜单。我已经尝试了所有选项,只有 4.0 版和更高版本的选项有效。选择 3.1.3 或更早的硬件版本会导致模拟器崩溃并显示“模拟应用程序退出”的错误消息。 (我忽略了 3.2,因为我收集的是仅限 iPad 的版本)
    【解决方案3】:

    您是否尝试过从 3.x 版本中删除框架库并在 4.x 版本中再次替换,然后清理 n 构建??

    【讨论】:

    • 这不是我要迁移的 3.x 项目(无论如何在这个阶段),所以没有 3.x 版本 - 我正在尝试获得一个全新的 在 xCode 4 中创建的项目可以正常工作。也就是说,我尝试手动更换框架,但没有任何改进。感谢您的建议,但这似乎也不是问题。
    【解决方案4】:

    打开项目的构建设置

    将关键 IOS DEPLOYMENT TARGET 指定为 3.2

    您为 4.3 编译。但是您的应用程序也将在 3.2 设备上运行..注意您调用的方法...如果您使用仅在 4.3 框架中的方法,则必须在运行时使用 if([object respondsToSelector: ... 否则你的应用会在以前的 iOS 上崩溃

    【讨论】:

      【解决方案5】:

      打开构建

      设置基础sdk:你想要的示例ios版本

      然后

      打开目标并双击它打开构建然后设置基础sdk。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-04-20
        • 1970-01-01
        • 1970-01-01
        • 2011-12-12
        • 1970-01-01
        • 2012-01-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多