菜鸟教程小白 发表于 2022-12-12 09:12:30

ios - 在 iPhone 上运行时出错,在模拟器上运行良好


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

<p>这是我得到的错误:</p>

<pre><code>Ld &#34;/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box&#34; normal armv7s
    cd &#34;/Users/xxx/Projects/xCode Projects/Munch Box&#34;
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    setenv PATH &#34;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin&#34;
    /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 &#34;/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&#34; -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 &#34;/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box&#34;

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:
&#34;_OBJC_CLASS_$_QREncoder&#34;, 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)
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>在build设置架构区域中关闭 armv7s。在 <a href="https://stackoverflow.com/questions/14900017/failing-archive-app-restkit-0-10/14901073#14901073" rel="noreferrer noopener nofollow">Failing Archive App RestKit 0.10</a> 上查看我的回答</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 iPhone 上运行时出错,在模拟器上运行良好,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/15120777/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/15120777/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 iPhone 上运行时出错,在模拟器上运行良好