Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for iOS fails when Bitcode is enabled #12

Open
Zazo032 opened this issue Jun 22, 2020 · 15 comments
Open

Build for iOS fails when Bitcode is enabled #12

Zazo032 opened this issue Jun 22, 2020 · 15 comments

Comments

@Zazo032
Copy link

Zazo032 commented Jun 22, 2020

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)
@haoliu-amp
Copy link
Contributor

Hey, so previously it doesn't happen to you?

@Zazo032
Copy link
Author

Zazo032 commented Jun 23, 2020

No, only after migrating to new Podfile template

@haoliu-amp
Copy link
Contributor

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.

@Zazo032
Copy link
Author

Zazo032 commented Jun 23, 2020

The Flutter version is in the first post, CocoaPods version is 1.9.3

@haoliu-amp
Copy link
Contributor

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?

@Zazo032
Copy link
Author

Zazo032 commented Aug 7, 2020

This is still happening in latest 1.20 stable, did you enable bitcode in order to trigger the error?

@haoliu-amp
Copy link
Contributor

I did enable it. Would you mind sending me an example app so I can try it out on my end if possible?

@ThomasKliszowski
Copy link

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

@marcuslma
Copy link

marcuslma commented Aug 18, 2020

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

@zjamshidi
Copy link

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)

@zjamshidi
Copy link

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

@zjamshidi
Copy link

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

@haoliu-amp
Copy link
Contributor

@zjamshidi Thank you very much! I've put this into our documentation under FAQ section.

https://developers.amplitude.com/docs/flutter-setup#faq

@Zazo032
Copy link
Author

Zazo032 commented Aug 31, 2020

@Zazo032
Copy link
Author

Zazo032 commented Aug 31, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants