无法运行使用iOS SDK 4.3编译的iOS 3.X应用程序

时间:2011-04-08 03:36:16

标签: ios ios4 xcode4 ios3.0

我最近升级到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,因此日志中出现“无法读取符号”的内容。我似乎无法弄清楚如何纠正这种情况。

感谢任何建议!

5 个答案:

答案 0 :(得分:3)

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

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

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

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

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

希望这会有所帮助:)

答案 1 :(得分:0)

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

答案 2 :(得分:0)

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

答案 3 :(得分:0)

打开项目的构建设置

将密钥IOS DEPLOYMENT TARGET指定为3.2

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

答案 4 :(得分:0)

打开构建

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

然后

打开目标并双击打开构建然后设置base sdk。