我的应用程序在模拟器上运行,但不在设备上运行

时间:2011-09-05 13:05:30

标签: ios xcode4 ipod-touch

我遇到了这个错误的问题:

Undefined symbols for architecture i386:

当我构建并开始时,它在模拟器上成功运行但在设备上没有运行,我尝试了一个简单的新项目,我尝试在设备上运行它,没关系,但是这个项目没有运行因为那个错误,完整的堆栈错误是这样的:

Ld "/Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Products/Debug-iphonesimulator/RM Unit Tests.app/RM Unit Tests" normal i386
    cd /Users/imac/Desktop/route-me-route-me-b07b654/MapView
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Products/Debug-iphonesimulator -F/Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Products/Debug-iphonesimulator -filelist "/Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Intermediates/MapView.build/Debug-iphonesimulator/Unit Tests.build/Objects-normal/i386/RM Unit Tests.LinkFileList" -mmacosx-version-min=10.6 -framework Foundation -framework UIKit -Xlinker -objc_abi_version -Xlinker 2 /Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Products/Debug-iphonesimulator/libProj4.a -framework CoreFoundation -framework CoreGraphics -framework CoreLocation -framework Foundation -lsqlite3 -framework QuartzCore -framework UIKit -o "/Users/imac/Library/Developer/Xcode/DerivedData/TopStation-cjwcuxabgkltqvdslykmwkeqvsee/Build/Products/Debug-iphonesimulator/RM Unit Tests.app/RM Unit Tests"

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_RMDBTileImage", referenced from:
      objc-class-ref in RMTileImage.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

我改变了构建模式,所以我选择了设备(在我的情况下我使用的是iPod 4.3.5),现在我还有一个错误:

'FavoriteCities.app' was built for 'i386', but the device 'iPod (Imac)' requires 'armv7' or compatible architecture.

FavoriteCities是我的应用程序名称,请帮我弄清楚导致这一切的问题是什么。

1 个答案:

答案 0 :(得分:1)

您需要更改设备构建的构建体系结构。对于iOS应用程序,默认情况下它应该是armv6 / 7,但我猜你或者其他什么搞砸了这些设置。

(在Xcode 4中)选择你的项目,转到Build Settings选项卡并确保它看起来像这样:

enter image description here