我的应用程序在模拟器上运行,但不在设备上 [英] My app is running on the simulator but not on the device

查看:48
本文介绍了我的应用程序在模拟器上运行,但不在设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个错误的问题:

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

我改变了构建模式,所以我选择了设备(在我的例子中我使用的是 iPod 4.3.5),现在我有另一个错误:

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

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

推荐答案

您需要更改设备构建的构建架构.对于 iOS 应用程序,默认情况下它应该是 armv6/7,但我猜您或您所做的事情弄乱了这些设置.

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.

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

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

这篇关于我的应用程序在模拟器上运行,但不在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆