When I compile framework with Xcode 8 and after that import in new project it successfully build and I am able to test it. But when I compile framework with Xcode 9 and after that add builded framework in new project I got:
Undefined symbols for architecture arm64:
"___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in xxxxxxxxx(DMCService.o)
___llvm_profile_runtime_user in xxxxxxxx(APXUserInterfacePresentor.o)
___llvm_profile_runtime_user in xxxxxxxxx(APXDevice.o)
___llvm_profile_runtime_user in xxxxxxxxx(APXInboxService.o)
___llvm_profile_runtime_user in xxxxxxxxx(AppoxeeManager.o)
___llvm_profile_runtime_user in xxxxxxxxx(APXApplicationSession.o)
___llvm_profile_runtime_user in xxxxxxxxx(APXInbox.o)
...
(maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture arm64
I check builded framework with -lipo -info architecture and it has arm64. This is happening only if I build framework for real device, if I build it for simulator it works fine. So I can not figure out why it is not working?
Thanks in advance for help.
Likely your framework build configuration has the setting "Enable Code Coverage Support" (the underlying setting name is CLANG_ENABLE_CODE_COVERAGE) set to YES, while in the application you include the framework, the same setting is set to NO. For why this causes the Undefined symbols error: enabling the setting causes calls to instrumentation functions to be injected into in the framework code. But when building the app, the library where these functions are defined is not linked. So the linker (ld) fails.
Try again, building the framework with Enable Code Coverage Support set to NO.
Also, to avoid these kind of configuration mis-match errors, you might want to build the app and framework at the same time instead of pre-building the framework separately. You can do this by including the framework project as a subproject of the app project, or creating a Xcode workspace that includes both the app project and the framework project.