简体   繁体   中英

iOS app builds on device, but not Simulator

I have an iOS app that fails to build on Simulator when the configuration is set to 'Release'. 'Debug' builds fine. Additionally, both 'Release' and 'Debug' configurations build on a real device. In Xcode, the error is:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_BMWAnalytics", referenced from:
 objc-class-ref in BMWManager.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've tried resetting the simulator, cleaning the project, and deleting derived data. What is causing this error and how do I fix it? A similar question is found here , but does not seem to include the discrepancy between 'Debug' and 'Release'.

That error just means that the code that provides the BMWAnalytics class is not being linked into your executable.

You need to make sure that the BMWAnalytics class's @implementation is provided by a file included in your target (or in a library that your target links against).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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