OGeek|极客世界-中国程序员成长平台

标题: ios - 在 iPhone 上运行时出错,在模拟器上运行良好 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 09:12
标题: ios - 在 iPhone 上运行时出错,在模拟器上运行良好

当我尝试在设备上运行时收到此错误。当我在模拟器上运行它时,它运行良好。

这是我得到的错误:

Ld "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box" normal armv7s
    cd "/Users/xxx/Projects/xCode Projects/Munch Box"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos -F/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos -filelist "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Intermediates/Munch Box.build/Debug-iphoneos/Munch Box.build/Objects-normal/armv7s/Munch Box.LinkFileList" -dead_strip -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -miphoneos-version-min=6.1 -framework CoreLocation -framework MapKit /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box"

ld: warning: ignoring file /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a, file was built for archive which is not the architecture being linked (armv7s): /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a
Undefined symbols for architecture armv7s:
  "_OBJC_CLASS_$_QREncoder", referenced from:
      objc-class-ref in TodaysCodeViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Best Answer-推荐答案


在build设置架构区域中关闭 armv7s。在 Failing Archive App RestKit 0.10 上查看我的回答

关于ios - 在 iPhone 上运行时出错,在模拟器上运行良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15120777/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4