I am getting the following error:
MyClass is unavailable: cannot find Swift declaration for this class
but I only get it when doing a release build in Xcode...Debug works fine.
Anyone know what's up? I'm running 6.3
If MyClass is inside a dynamic framework (Cocoa Touch Framework), It is likely that you're using a build with wrong architecture. To check, browse your MyClass.framework in finder, and check Modules/AirServiceKit.swiftmodule
. There should be something like x86_64.swiftmodule
or arm64.swiftmodule
, if you're using simulator there should be x86, or arm if you're building for device.
In case anyone else encounter this problem:
I had the exact same error and turned out that I had built my framework for an specific emulator. I changed the device
(in upper left corner) to Generic iOS device
and did a clean
and build
, then I used the generated .framework
file.
Everything worked just fine after using this generated .framework
file.
In my case, it was because my framework that I am developing was missing one of the Valid Architectures listed in my app's target. All I had to do was the following:
In my case, my framework was missing arm64
.
Check the flag value you have set for Build Active Architectures Only in Build Settings for Debug and Release
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With