Amplitude-Flutter
Amplitude-Flutter copied to clipboard
Build for iOS fails when Bitcode is enabled
After regenerating the Podfile
file using rm ios/Podfile
, and trying to build, the build fails. This was done because the tool itself suggested it (maybe some changes to that file in latest Flutter versions).
Running pod install... 5,3s
Warning: Podfile is out of date
This can cause issues if your application depends on plugins that do not
support iOS.
See
https://flutter.dev/docs/development/packages-and-plugins/developing-packages#
plugin-platforms for details.
If you have local Podfile edits you would like to keep, see
https://github.com/flutter/flutter/issues/45197 for instructions.
To regenerate the Podfile, run:
rm ios/Podfile
Running Xcode build...
This is the related error log:
ld:
'/Users/cristianzazo/<elided>/build/ios/Release-iphoneos/Amplitude/Amplitu
de.framework/Amplitude' 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. file
'/Users/cristianzazo/<elided>/build/ios/Release-iphoneos/Amplitude/Amplitu
de.framework/Amplitude' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
ld:
'/Users/cristianzazo/<elided>/build/ios/Release-iphoneos/Amplitude/Amplitu
de.framework/Amplitude' 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. file
'/Users/cristianzazo/<elided>/build/ios/Release-iphoneos/Amplitude/Amplitu
de.framework/Amplitude' for architecture arm64
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
[✓] Flutter (Channel master, 1.20.0-1.0.pre.132, on Mac OS X 10.15.5 19F101,
locale es-ES)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
Hey, so previously it doesn't happen to you?
No, only after migrating to new Podfile
template
So you regenerate the Podfile for your project, right? What is your current Cocoapods and Flutter version? Knowing these will help me get it reproduced locally.
The Flutter version is in the first post, CocoaPods version is 1.9.3
I tried it locally, but can't get it reproduced.
However, the versions for each tools I am using are cocoapods: 1.9.1 flutter: Flutter 1.18.0-11.0.pre
Would you like to try to switch same versions and give it a shot?
This is still happening in latest 1.20 stable, did you enable bitcode in order to trigger the error?
I did enable it. Would you mind sending me an example app so I can try it out on my end if possible?
I have the same problem. If I remove the Podfile in order to make the new one, I get this bitcode issue.
$ pod --version
1.9.1
$ flutter --version
Flutter 1.20.2 • channel stable • https://github.com/flutter/flutter
Framework • revision bbfbf1770c (4 days ago) • 2020-08-13 08:33:09 -0700
Engine • revision 9d5b21729f
Tools • Dart 2.9.1
Same problem here, I reverted flutter version to make it work. The error started after migrating to new stable version 1.20. I opened the issue #15
I have the same problem. I wanted to reduce the app size, so I enabled the bitcode flag. Then the project failed to build:
ld: '/Users/zahra/FlutterProjects/motiveex_fluttter/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude'
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. file
'/Users/zahra/FlutterProjects/motiveex_fluttter/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude' for
architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: '/Users/zahra/FlutterProjects/motiveex_fluttter/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude'
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. file
'/Users/zahra/FlutterProjects/motiveex_fluttter/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude' for
architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
here is the output of flutter doctor:
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.5 19F101, locale en-LK)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
I'm using amplitude_flutter: ^2.0.0
in my project
I solved my issue. According to flutter documentation:
You should also remove config.build_settings['ENABLE_BITCODE'] = 'NO' from the Podfile
https://github.com/flutter/flutter/wiki/Creating-an-iOS-Bitcode-enabled-app
@zjamshidi Thank you very much! I've put this into our documentation under FAQ section.
https://developers.amplitude.com/docs/flutter-setup#faq
This will probably have to be updated too: https://github.com/amplitude/Amplitude-Flutter/search?q=ENABLE_BITCODE&unscoped_q=ENABLE_BITCODE
Example: https://github.com/flutter/flutter/pull/39851/files
As this plugin is now using the iOS pod natively, maybe bitcode should be enabled there?
ld: '/Users/cristianzazo/sample/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude' 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.
file '/Users/cristianzazo/sample/build/ios/Release-iphoneos/Amplitude/Amplitude.framework/Amplitude' for architecture arm64
clang: error: linker command failed with exit code 1