skip to Main Content

I’m facing this issue when I try to run the app in Xcode. my Xcode version is 13.2.1 (13C100)

-U and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

Here’s my podfile

$RNFirebaseAsStaticFramework = true
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false

target 'Mcsc' do
  use_frameworks!
  config = use_native_modules!

  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'

  pod 'GoogleMaps'

  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
  pod 'GoogleUtilities', :modular_headers => true
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'FirebaseStorage', :modular_headers => true
  pod 'FirebaseStorageInternal', :modular_headers => true
  pod 'FirebaseAppCheckInterop', :modular_headers => true
  pod 'FirebaseAuthInterop', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'McscTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  # use_flipper!()

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
        def pod.build_type;
          # Uncomment the line corresponding to your CocoaPods version
          Pod::BuildType.static_library # >= 1.9
          # Pod::Target::BuildType.static_library # < 1.9
        end
      end
    end
  end

  post_install do |installer|
    # config.build_settings['ENABLE_BITCODE'] = 'NO'
    # Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    `sed -i -e  $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
  end
end

Any help would be great! I tried disabling bitcode and it still showed ENABLE_BITCODE=YES in the error message – cleaned my build folder too. Really out of ideas right now.

2

Answers


  1. Chosen as BEST ANSWER

    Bitcode is deprecated in Xcode 14. So, it is perhaps best to simply disable it, then there's no problem. In Podfile in postinstall add these lines

    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
    
    

  2. In my case I had to remove use_frameworks! and use

      pod 'Firebase', :modular_headers => true
      pod 'FirebaseCore', :modular_headers => true
      pod 'GoogleUtilities', :modular_headers => true
      $RNFirebaseAsStaticFramework = true
    

    instead.
    So my Podfile looked like this

    require_relative '../node_modules/react-native/scripts/react_native_pods'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    
    platform :ios, '12.4'
    install! 'cocoapods', :deterministic_uuids => false
    
    
    target 'opinion' do
      config = use_native_modules!
    
      # Flags change depending on the env values.
      flags = get_default_flags()
    
      pod 'Firebase', :modular_headers => true
      pod 'FirebaseCore', :modular_headers => true
      pod 'GoogleUtilities', :modular_headers => true
      $RNFirebaseAsStaticFramework = true
    
      use_react_native!(
        :path => config[:reactNativePath],
        # Hermes is now enabled by default. Disable by setting this flag to false.
        # Upcoming versions of React Native may rely on get_default_flags(), but
        # we make it explicit here to aid in the React Native upgrade process.
        :hermes_enabled => true,
        :fabric_enabled => flags[:fabric_enabled],
        # Enables Flipper.
        #
        # Note that if you have use_frameworks! enabled, Flipper will not work and
        # you should disable the next line.
        :flipper_configuration => FlipperConfiguration.enabled,
        # An absolute path to your application root.
        :app_path => "#{Pod::Config.instance.installation_root}/.."
      )
    
      target 'opinionTests' do
        inherit! :complete
        # Pods for testing
      end
    
      post_install do |installer|
        react_native_post_install(
          installer,
          # Set `mac_catalyst_enabled` to `true` in order to apply patches
          # necessary for Mac Catalyst builds
          :mac_catalyst_enabled => false
        )
        __apply_Xcode_12_5_M1_post_install_workaround(installer)
      end
    end
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search