PeopleInSpace: Can not run the watchOS app on the emulator
Reproduction steps:
- clone the repository
- open .xcworkspace in Xcode
- change signing to local team
- attempt to run on the local emulator
This is the output I get:
ld: warning: ignoring file /Volumes/macApps/fhswf/S5/Projekt/PeopleInSpace/common/build/cocoapods/framework/common.framework/common, building for watchOS Simulator-x86_64 but attempting to link with file built for watchOS Simulator-i386
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CommonKoinKt", referenced from:
objc-class-ref in ExtensionDelegate.o
"_OBJC_CLASS_$_CommonAssignment", referenced from:
objc-class-ref in ViewModel.o
"_OBJC_CLASS_$_CommonPeopleInSpaceRepository", referenced from:
objc-class-ref in ContentView.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 guess the warning
watchOS Simulator-x86_64 but attempting to link with file built for watchOS Simulator-i386
already tells a lot but I am not sure how to change that
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 22 (18 by maintainers)
@joreilly Seems to be succesfull! I tested with Gradle 7.0.0 and Ktor 1.6.2 and SQLdelight 1.5.1 ✅
I still have to setup my project, so that I can create PR’s. Will do asap
Correct @joreilly . I opened issues on all the dependencies that were not yet supporting it. Some have implemented it, but it is still only in the master branch, not into a release. I guess it’ll will need some time or you have to rely on unstable ‘releases’. which is not really a good option I think.
Thanks, this did fix it! Just wanted to also leave a screenshot here for anyone facing the same issue with the steps you described.
That means this cannot be fixed for everyone by changing the code in the repository?
Okay, that took a few hours, messing around to try and get a minimal change that will allow compiling for the watchos simulator. It seems to be compiling for ARM64 simulators by default, and that really doesn’t work at all, since the KMP module (common) gets compiled for i386 and then it’ll skip linking it.
What did I do to get it working?
Now a build should finish and install.
Really not sure how to make this work for both simulator and real hardware devices without having to edit these. Absolutely no idea. Maybe someone more familiar can fill me in on how things should be done.
Hope this helps.