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

Flutter.framework/Flutter' does not contain bitcode #152

Closed
vivdub opened this issue Oct 5, 2019 · 15 comments
Closed

Flutter.framework/Flutter' does not contain bitcode #152

vivdub opened this issue Oct 5, 2019 · 15 comments
Labels
Help Wanted Extra attention is needed

Comments

@vivdub
Copy link

vivdub commented Oct 5, 2019

Hi,
I am getting the following issue after adding OneSignal SDK.

'/Users/vivekdubey/Documents/flutter/bin/cache/artifacts/engine/ios-release/
    Flutter.framework/Flutter' does not contain bitcode. You must rebuild it
    with bitcode enabled (Xcode setting ENABLE_BITCODE), o'btain an updated
    library from the vendor, or disable bitcode for this target. file
    '/Users/vivekdubey/Documents/flutter/bin/cache/artifacts/engine/ios-release/
    Flutter.framework/Flutter' for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see
    invocation)
    note: Using new build systemnote: Planning buildnote: Constructing build
    description

As per the previous threads here 'Enable Bitcode'is set to 'No' for Runner project, however I do not find same setting for 'OneSignalNotificationServiceExtension'.

I also see that in Pod file this is set to no for all.

Below is the POD file:

# Uncomment this line to define a global platform for your project
 platform :ios, '10.2'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  use_frameworks!

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

target 'OneSignalNotificationServiceExtension' do
  use_frameworks!
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

The code runs from command line but does not creates a build, neither from Xcode.
Did I missed anything ?

@el12n
Copy link

el12n commented Oct 7, 2019

I'm having the same issue tryin to build the iOS version.

@el12n
Copy link

el12n commented Oct 7, 2019

Fixed following this steps #42 (comment)

@vivdub
Copy link
Author

vivdub commented Oct 8, 2019

Will try this.

@vivdub
Copy link
Author

vivdub commented Oct 8, 2019

HI,
I tried but I am not sure what to add, for now my project mainly contains a webview plugin and IOS notifications.
Here are the things I added.

flutter_webview_plugin.framework
onesignal_flutter_framework
Pods_OneSignalNotificationServiceExtension.framework
Pods_Runner.framework
UserNotifications.framework

@Goolpe
Copy link

Goolpe commented Oct 11, 2019

@vivdub did you open all settings?
Снимок экрана 2019-10-11 в 11 53 46
Here 'Enable bitcode' you must change to 'No'

@rgomezp rgomezp added the Help Wanted Extra attention is needed label Oct 11, 2019
@vivdub
Copy link
Author

vivdub commented Oct 12, 2019

Yes I did that, this was the solution suggested in few threads, but it did not worked.
If there is something else that needed to be done after disabling then I am not sure, I disabled, then cleaned the build folder and rebuilt again.

@vivdub
Copy link
Author

vivdub commented Oct 12, 2019

Oh one more thing, I was seeing this build option inside Runner, but it was not there in OneSignal, when I added a custom variable, it said it is already there.
May be this is the issue, any comments on this ?
Also in the pod file, I think it is set to NO for all.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

@rgomezp
Copy link
Contributor

rgomezp commented Oct 21, 2019

This is not a OneSignal issue. Please contact our suppor channel at OneSignal.com if you are looking for OneSignal-related help. Cheers

@rgomezp rgomezp closed this as completed Oct 21, 2019
@vivdub
Copy link
Author

vivdub commented Oct 22, 2019

Where exactly on OneSignal.com ?

@rgomezp
Copy link
Contributor

rgomezp commented Oct 22, 2019

There is a chat bubble in the bottom right

@vivdub
Copy link
Author

vivdub commented Oct 23, 2019

ok Thanks

@OpticNectar
Copy link

Go to Xcode:

Project -> Building Settings -> Enable Bitcode Set to 'NO'

For me it was set to YES for some reason.

@vivdub
Copy link
Author

vivdub commented Mar 11, 2020

HI,
It was already No for me.
Thanks

@Howard-Flipped
Copy link

Oh one more thing, I was seeing this build option inside Runner, but it was not there in OneSignal, when I added a custom variable, it said it is already there.
May be this is the issue, any comments on this ?
Also in the pod file, I think it is set to NO for all.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Thanks a lot, it works for me!
I use Flutter develop one app, it have to use a Flutter plugin , and the plugin import a ios .framework, aways report this error: "does not contain bitcode" when i build project.
But i had set Xcode settings correct, after try long time, i use method above in my Flutter/ios/Podfile. Then fix it.
Thanks again!

1 similar comment
@Howard-Flipped
Copy link

Oh one more thing, I was seeing this build option inside Runner, but it was not there in OneSignal, when I added a custom variable, it said it is already there.
May be this is the issue, any comments on this ?
Also in the pod file, I think it is set to NO for all.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Thanks a lot, it works for me!
I use Flutter develop one app, it have to use a Flutter plugin , and the plugin import a ios .framework, aways report this error: "does not contain bitcode" when i build project.
But i had set Xcode settings correct, after try long time, i use method above in my Flutter/ios/Podfile. Then fix it.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants