App extension was built without bitcode - Only on M1 mac
Asked Answered
S

1

7

I have just updated my iMac to an M1 and now one of my projects is giving me these warnings for 3 of the libraries embedded in a Widget Extension:

ld: warning: all bitcode will be dropped because '/Users/..../DJSwiftHelpers_Extension' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.

I understand that the app needs all libraries to be built with bitcode in order to be bitcode compatible. 2 of the libraries are my own, one in fact is actually built inside the same project and all have bitcode enabled.

The libraries have 2 versions, 1 with "Allow app extension safe API only" and the other without. It's only the app extension libraries that are an issue.

Those embedded in a Watch extension are fine. Those embedded in Intents are fine. It's just the Widget extension that complains.

I can clear the warnings by disabling bitcode for the Widget Extension, however on uploading the app to the App Store, bitcode is in fact disabled for the whole app.

So I guess my questions are:

Why has this only become an issue on an M1 mac and not on my Intel Mac?

Can widget extensions support bitcode? Or is the bitcode setting just ignored?

Is it really impossible to use bitcode when providing a Widget Extension?

Scaramouch answered 12/9, 2021 at 11:59 Comment(1)
Ok, it actually seems that this only happens when building for the simulator. When I archive the app it builds with bitcode just fine.Scaramouch
E
1

It seems to be an issue with Mac M1 simulator and bitcode.

There is an open bug reported to Apple : Include bitcode in Xcode toolchain libraries.

Here is the answer from Steven Wu :

Here are few things about bitcode:

Bitcode is not support on macOS and simulators* (more about simulator below)

Built without bitcode only turns into an error during archive build option (and only emitted during that build action to save build time and disk space)

When building during development, either for device or for simulator, linker will only do a quick sanity check to surface any build configuration issues about bitcode that might turn into an error during archive time. That is the warning you see here.

In your situation, you can safely ignore those warnings. The compatibility libraries are built with bitcode for iphoneos/watchOS/tvOS so you won't hit that problem during archive build for submission. On the other hand, feel free to file a bug report to feedbackassistant.apple.com or using the feedback app for suggestion to improve with spurious warnings.

Ethanol answered 15/3, 2022 at 17:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.