My app is running on the simulator but not on the device

a 夏天 提交于 2020-02-05 03:25:11

问题


I have a problem with that error :

Undefined symbols for architecture i386:

When I build and go, it run successfully on the simulator but not on the device, I try a simple new project, I try to run it on the device, it was ok, but this project didn't run because of that error, the full stack error is this :

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

I changed the build mode, so I have choosed the device(in my case i use an iPod 4.3.5), now I have an other error :

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

FavoriteCities is my application name, please help me to figure out what could be the problem causing all that.


回答1:


You need to change build architecture for device builds. It should have been armv6/7 by default for iOS app, but I guess you or something you did messed those settings up.

(In Xcode 4) select your project, go to Build Settings tab and make sure it looks like this:



来源:https://stackoverflow.com/questions/7308523/my-app-is-running-on-the-simulator-but-not-on-the-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!