繁体   English   中英

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

[英]My app is running on the simulator but not on the device

我对该错误有疑问:

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是我的应用程序名称,请帮助我找出导致所有问题的原因。

您需要更改设备构建的构建体系结构。 对于iOS应用程序,默认情况下应该为armv6 / 7,但我想您或您所做的事情弄乱了这些设置。

(在Xcode 4中)选择您的项目,转到“构建设置”选项卡,并确保它看起来像这样:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM