Bitcode compilation error with Google Analytics library in Xcode

I’m running into a build issue after updating to a newer version of Xcode. When I try to compile my project that includes Google Analytics, I get this linker error:

ld: '/path/to/project/ThirdParty/Analytics/GoogleSDK/libAdIdAccess.a(GADRealAdIdAccess.o)' does not contain 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. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem seems to be that the Google Analytics static library doesn’t have bitcode support built in. I know I can turn off bitcode completely for my entire project, but that doesn’t seem like the best solution. Is there a way to disable bitcode requirements for just this specific library while keeping it enabled for the rest of my code? I’d rather not disable this feature entirely if I can help it.

Been dealing with this mess for years. Update your Google Analytics dependency first - grab the latest from CocoaPods or download it directly.

If that doesn’t work, you’ve got two solid options. First is what josephk said - disable bitcode for your main target only. Second is switching to the framework version instead of the static library if Google has it. Frameworks handle bitcode better and cause fewer headaches.

I’ve seen teams exclude specific architectures that break things. In Build Settings, find ‘Excluded Architectures’ and try adding armv7 for debug builds. Won’t affect release builds but lets you keep developing.

Worst case, add a build phase script that strips bitcode from just that library before linking. It’s hacky but works when nothing else does. Used this on a banking app where we couldn’t touch certain security libraries.

Had this exact problem six months ago on a client project. Easiest fix is disabling bitcode at the target level, not globally. Go to your app target’s Build Settings, find ‘Enable Bitcode’ and set it to NO for just that target. Your frameworks and extensions keep bitcode support while your main app bypasses the restriction. Before you do this though - check if Google updated their Analytics SDK. They’ve been good about adding bitcode support to newer versions. If you’re on an old version, just upgrading might fix everything without touching build settings. I used the target-specific fix in production and never had App Store submission problems.

Check how you’re integrating Google Analytics first. If you’re adding the static library files manually, switch to CocoaPods or Swift Package Manager instead. They handle bitcode compatibility automatically and grab the right library versions. What worked for me was wrapping the Google Analytics library in a separate framework. This isolates the bitcode problem and lets you control compilation flags better. You can disable bitcode just for the wrapper while keeping it on everywhere else. Also make sure you’re not mixing old cached files with new ones. Completely clean your DerivedData folder and rebuild from scratch. Xcode sometimes hangs onto old library references that cause linking conflicts even after you update dependencies.