Hi everyone, I'm facing problems to export my .framework to be used in xcode projects (without the need of Run Script in gradle)
When I just drag&drop the framework file from the <my-kmp-project>/build/framework/ and try to run, I get the following errors:
ld: warning: ignoring file /Users/.../BC_lib Demo/BC_lib.framework/BC_lib, building for iOS-arm64 but attempting to link with file built for iOS Simulator-x86_64
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_KotlinMutableDictionary", referenced from:
"_OBJC_CLASS_$_BC_libPinpadOutput", referenced from:
"_OBJC_CLASS_$_BC_libCommonKt", referenced from:
"_OBJC_CLASS_$_BC_libPinpadCompanion", referenced from:
ld: symbol(s) not found for architecture arm64
Are there any extra steps that I should do to be able to use my framework when developing to devices (on simulators things work)
Artyom Degtyarev [JB]
2 years ago
Hello, @Arthur Brum! Can you tell if this framework is a result of targeting
iosArm<64 | 32>
? On a first sight, it seems like you’re feeding Xcode with incorrect framework. If you are sure that that’s not the problem…
Maybe Xcode cached the simulator framework somewhere inside, and you should clean build folder etc. Check the project folder contents manually and make sure that correct framework is in place.
Oh, thanks @Artyom Degtyarev [JB]!
Indeed it was just a wrong cached version for some reason...And FYI, I was setting the target conditionally, so I could build to simulator and device.. Thats probably why it happened... even though I made sure to build for physical device before copying the framework
Now that I tried to build to simulator just to make some UI changes I get the related error saying that I dont have symbols for
I've read somewhere saying that apple don't accept apps which their included frameworks have extra symbols to different archtecture mixed up.
What would be the best way to set this so that I can build to both simulator and device without having to switch framework files?