Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Unable to archive with Xcode versions below 12.5 #310

Closed donatoaguirre24 closed 3 years ago

donatoaguirre24 commented 3 years ago

Report

After integrating the SDK, I can archive my app locally using Xcode 12.5.1, but CD builds fail. Our CD pipeline uses App Center which provides Xcode 12.4 as the newest version. I also asked a teammate to try archiving the app but is failing for him as well, he's running Xcode 12.2.

The error in both App Center and my teammate's machine states the SDK has been compiled using Clang 1205.0.22.11 which ships with Xcode 12.5.1 making it incompatible with previous versions.

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1205.0.22.11.0_0' Reader: '1200.0.32.29_0')', using libLTO version 'LLVM version 12.0.0, (clang-1200.0.32.29)' for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **

##[error]Error: /usr/bin/xcodebuild failed with return code: 65

Describe your environment.

Info Value
Platform Name iOS
Platform Version any
SDK Version 4.3.2
Integration Method Cocoapods
Xcode Version Xcode 12.4
Computer Processor Intel-based
Repro rate 100%

What did you do?

Integrate Braze through Cocoapods.

What did you expect to happen?

Braze SDK is integrated properly and the app builds without errors.

What happened instead?

The build process fails due to an incompatible bitcode bundle.

Steps to reproduce

Are you doing any feature customizations that may relate to the issue? Can you share the code snippet?

No. We target iOS >= 12

hokstuff commented 3 years ago

Hi @donatoaguirre24,

Thanks for filing this issue. What is the version you are upgrading from, and what features are you looking to use when upgrading to 4.3.2?

The root cause appears to be from this open issue with AppCenter since the service doesn't provide the latest version of Xcode. Braze generally releases with the latest version of Xcode - in the meantime you can explore workarounds like using previous versions of the SDK (if your use case doesn't require you to use the latest one) or using resources online to remove the bitcode from the release binaries. Let us know if either of those suggestions work for you!

donatoaguirre24 commented 3 years ago

Hi @hokstuff,

We just integrated Braze SDK into our app, so naturally, we installed the latest version of react-native-appboy-sdk (1.32.0) which adds the Appboy-iOS-SDK pod in its last version (4.3.2)

Yes, App Center is an issue, we're planning to drop them in the short term. If you guys intentionally release with the latest version of Xcode, we'll probably deploy locally until we move from App Center or they add support for Xcode 12.5.

Do you mind expanding o this: "using resources online to remove the bitcode from the release binaries"? We should remove the bitcode before building the app?

Thanks for your help!

donatoaguirre24 commented 3 years ago

App Center just added Xcode 12.5 support. Just in time 😂

sourabhdadapure commented 2 years ago

Whats the fix for Xcode versions below 12.5 without having to upgrade to 12.5? I'm using XCode 12.4

hokstuff commented 2 years ago

Hi @sourabhdadapure,

As the root cause of the issue is with AppCenter, there is no known workaround for Xcode versions below 12.5. We recommend updating to a newer version of Xcode in order to continue using AppCenter.