chaimPaneth / react-native-zoom-bridge

23 stars 15 forks source link

MobileRTC doesn't contain bitcode #21

Closed user1701 closed 4 years ago

user1701 commented 4 years ago

While building an app in the appcenter.ms I face the following issue:

ld: '/Users/runner/work/1/s/node_modules/react-native-zoom-bridge/ios/libs/MobileRTC.framework/MobileRTC' 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/runner/work/1/s/node_modules/react-native-zoom-bridge/ios/libs/MobileRTC.framework/MobileRTC' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
chaimPaneth commented 4 years ago

@user1701 You need to disable bitcode in appcenter for this build, MobileRTC SDK doesn't support bitcode and that's why it's disabled.

user1701 commented 4 years ago

We have to disable BITCODE for the main project and pod projects. You can disable it for the main project in the XCode->project name-> Build Settings and there search for the bitcode and set to no. This setting for pod projects have to be updated in the Podfile. I wrote the code according to other prods settings in the section because in most cases on the StackOverflow was used target but in my case is used target_installation_result... I have fixed it with the following code:

post_install do |installer|
  installer.pods_project.main_group.tab_width = '2';
  installer.pods_project.main_group.indent_width = '2';
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
    # Can't specify this in the React podspec because we need to use those podspecs for detached
    # projects which don't reference ExponentCPP.
    if pod_name.start_with?('React')
      target_installation_result.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
        config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
      end
    end

    target_installation_result.native_target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end