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

'RCTConvert+AirMap.h' file not found #3597

Closed
WASHSWATDAVID opened this issue Oct 29, 2020 · 32 comments
Closed

'RCTConvert+AirMap.h' file not found #3597

WASHSWATDAVID opened this issue Oct 29, 2020 · 32 comments
Labels

Comments

@WASHSWATDAVID
Copy link

WASHSWATDAVID commented Oct 29, 2020

Bug report

Summary

Environment info

react-native info output:

System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 50.64 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 8.8.1 - ~/.nvm/versions/node/v8.8.1/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 5.4.2 - ~/.nvm/versions/node/v8.8.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 3.1 AI-173.4907809
    Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_181 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: ^4.13.0 => 4.13.0 
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

My Xcode version 12.1 (12A7403)
"react-native-maps": "0.27.1",

Podfile

  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

Steps to reproduce

When I build my ios project always shown 'RCTConvert+AirMap.h' file not found message

Screen Shot 2020-10-30 at 4 25 46 AM

@JavyMB
Copy link

JavyMB commented Oct 30, 2020

Hi @WASHSWATDAVID
This might help #1193 or #3390

@matheusmurbi
Copy link

Have you find a solution? I'm facing the same problem

@fungland
Copy link

fungland commented Dec 15, 2020

Have you find a solution? I'm facing the same problem

try add below code to your ios/Podfile even your RN is higher then 0.59

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-google-maps'
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
      end
    end
  end
end

https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#using-cocoapods-react-native-059-and-lower

@stale
Copy link

stale bot commented Feb 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 13, 2021
@stale stale bot closed this as completed Feb 20, 2021
@ryansaam
Copy link

I'm also having this issue with a fresh react native project using typescript template. react 17.0.1 react-native 0.64.1 react-native-maps 0.28.0 . I'm searching for a solution but if I can't find one I'm hoping someone can post one here.

@ryansaam
Copy link

I don't know why it no longer says this in the installation instructions but I've seen it on YouTube of people installing older versions on this library and the instruction use to say to put pod 'GoogleMaps' in your pod file.

my pod file now looks like:

target 'MyApp' do
  # react-native-maps
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  # end

  ...

This fixed it for me, hope it helps people in the future.

@JustineUIT
Copy link

I don't know why it no longer says this in the installation instructions but I've seen it on YouTube of people installing older versions on this library and the instruction use to say to put pod 'GoogleMaps' in your pod file.

my pod file now looks like:

target 'MyApp' do
  # react-native-maps
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  # end

  ...

This fixed it for me, hope it helps people in the future.

This one not work for me, in case i am using use_framework! in my podfile.
I also try this instruction: https://github.com/googlemaps/google-maps-ios-utils/blob/b721e95a500d0c9a4fd93738e83fc86c2a57ac89/Swift.md but does not work!
Anyone have a full guide to install react-native-maps with use_framework!. I tried all the tutorials on the internet but none of them really worked

@yadigar-prospr
Copy link

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

@TheBlackHacker
Copy link

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

Thanks you, work like a charm!

@riddy6421
Copy link

config

Works Great!

@akinlekan28
Copy link

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

Worked perfectly, thanks

@kevin-mcs
Copy link

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

Worked perfectly, thanks 💯

@joshke
Copy link

joshke commented Sep 1, 2022

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

Thanks, worked here also perfectly :) !

@brascene
Copy link

brascene commented Sep 9, 2022

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

This really worked, thanks a lot! however I almost have no idea what these pre and post installers do.. and can they be included at the lib level?

@talhauzair-28
Copy link

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

Thank you for such a perfect solution.

@Silthus
Copy link

Silthus commented Oct 21, 2022

Does someone know how to fix this error using the expo managed workflow with a standalone (development) client build?

I added the useFrameworks: 'static' option but the build fails with the same error as described above.

Here is the app.json:

{
  "expo": {
    "name": "MyProject",
    "slug": "my-app",
    "owner": "silthus",
    "version": "1.0.0-dev.52",
    "runtimeVersion": "1.8.1",
    "orientation": "portrait",
    "icon": "./assets/images/app-icon-all.png",
    "splash": {
      "image": "./assets/images/splash-logo-all.png",
      "resizeMode": "contain",
      "backgroundColor": "#191015"
    },
    "plugins": [
      "@react-native-firebase/app",
      "@react-native-firebase/perf",
      "@react-native-firebase/crashlytics",
      "expo-notifications",
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ],
    "updates": {
      "fallbackToCacheTimeout": 0,
      "url": "https://u.expo.dev/XXXXXXXXXXXXXXXXXXXXXX"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "android": {
      "icon": "./assets/images/app-icon-android-legacy.png",
      "googleServicesFile": "google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/app-icon-android-adaptive-foreground.png",
        "backgroundImage": "./assets/images/app-icon-android-adaptive-background.png"
      },
      "splash": {
        "image": "./assets/images/splash-logo-android-universal.png",
        "resizeMode": "contain",
        "backgroundColor": "#191015"
      },
      "config": {
        "googleMaps": {
          "apiKey": "XXXXXXXXXXXXXXXXXXXXXXXXX"
        }
      },
      "versionCode": 52
    },
    "ios": {
      "icon": "./assets/images/app-icon-ios.png",
      "supportsTablet": true,
      "splash": {
        "image": "./assets/images/splash-logo-ios-mobile.png",
        "tabletImage": "./assets/images/splash-logo-ios-tablet.png",
        "resizeMode": "contain",
        "backgroundColor": "#191015"
      },
      "config": {
        "googleMapsApiKey": "XXXXXXXXXXXXXXXXX"
      },
      "buildNumber": "1.0.0"
    },
    "web": {
      "favicon": "./assets/images/app-icon-web-favicon.png",
      "splash": {
        "image": "./assets/images/splash-logo-web.png",
        "resizeMode": "contain",
        "backgroundColor": "#191015"
      },
      "build": {
        "babel": {
          "include": [
            "@ui-kitten/components"
          ]
        }
      }
    }
  }
}

@beydogan
Copy link

@Silthus I started getting the same error for my Expo project, I'm unsure but I think it started after Expo 46 upgrade. Have you found a solution?

@BrodaNoel
Copy link
Contributor

Same issue here after adding useFrameworks: 'static'

@Silthus
Copy link

Silthus commented Oct 26, 2022

I made it work following this discussion thread. The solution, or better say workaround, for the problem is the following:

Create a react-native-maps-plugin.js in the root of the project with the following content:

const fs = require('fs');
const path = require('path');
const generateCode = require('@expo/config-plugins/build/utils/generateCode');
const configPlugins = require('@expo/config-plugins');

const code = `
$static_library = [
 'React',
 'Google-Maps-iOS-Utils',
 'GoogleMaps',
 'react-native-maps',
 'react-native-google-maps',
 'React-hermes'
]

pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      bt = pod.send(:build_type)
      if $static_library.include?(pod.name)
        puts "Overriding the build_type to static_library from static_framework for #{pod.name}"
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
    installer.pod_targets.each do |pod|
      bt = pod.send(:build_type)
      puts "#{pod.name} (#{bt})"
      puts "  linkage: #{bt.send(:linkage)} packaging: #{bt.send(:packaging)}"
    end
end`;

module.exports = (config) => {
    return configPlugins.withDangerousMod(config, [
        'ios',
        async (config) => {
            const filePath = path.join(
                config.modRequest.platformProjectRoot,
                'Podfile'
            );
            const contents = fs.readFileSync(filePath, 'utf-8');

            const addCode = generateCode.mergeContents({
                tag: 'withReactNativeFirebase',
                src: contents,
                newSrc: code,
                anchor: /\s*get_default_flags\(\)/i,
                offset: 2,
                comment: '#',
            });

            if (!addCode.didMerge) {
                console.error(
                    "ERROR: Cannot add withReactNativeMaps to the project's ios/Podfile because it's malformed."
                );
                return config;
            }

            fs.writeFileSync(filePath, addCode.contents);

            return config;
        },
    ]);
};

Then load then plugin inside app.json and set useFrameworks: 'static' and deploymentTarget: "13.0":

...
    "plugins": [
      "@react-native-firebase/app",
      "@react-native-firebase/perf",
      "@react-native-firebase/crashlytics",
      "expo-notifications",
      "./react-native-maps-plugin", // <--- this one here without the .js ending
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static",
            "deploymentTarget": "13.0"
          }
        }
      ]
    ],
...

See the linked thread for more information and some alternative solutions.

In the long run however, I think this should be made as an official Expo plugin. I might send a PR if I find the time.

@talhauzair-28
Copy link

Please see the solution: #3597 (comment)

This solved my problem. @BrodaNoel @beydogan

@BrodaNoel
Copy link
Contributor

Please see the solution: #3597 (comment)

This solved my problem. @BrodaNoel @beydogan

That doesn't seem to apply for devs using Expo

@beydogan
Copy link

I'm using expo and removing expo-firebase-analytics package has solved the problem for me. I haven't figured it out yet why exactly since I needed an urgent fix. I don't know how having that package breaks this one.

@bobowinca
Copy link

yadigar-prospr

This solution works perfectly! Thank you so much!

@rupam999
Copy link

rupam999 commented Dec 7, 2022

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

**

ANY SOLUTION

**

After this I am getting
error Failed to launch the app on simulator, An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Application launch for 'org.reactjs.native.example.App' did not return a valid pid nor a launch error.
No such process

Below is my pod file

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

$RNFirebaseAsStaticFramework = true

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

target 'App' do
  $static_framework = []
  config = use_native_modules!

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

  # React Native Maps dependencies
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path

  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  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 'AppTests' do
    inherit! :complete
    # Pods for testing
  end

  # ****** THIS IS THE MAGIC ******
  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
  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)
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end

@SohelIslamImran
Copy link

Facing the same issue. After upgraded to SDK47, eas, my IOS builds getting fail.
image

Run fastlane section last logs:

› Compiling build Pods/react-native-google-maps » react-native-google-maps-dummy.m
› Compiling react-native-maps Pods/react-native-google-maps » RCTConvert+GMSMapViewType.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapWMSTileManager.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapWMSTile.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapUrlTile.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapURLTileManager.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolylineManager.m

❌  (node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m:17:9)

  15 | #import <React/RCTViewManager.h>
  16 | #import <React/UIView+React.h>
> 17 | #import "RCTConvert+AirMap.h"
     |         ^ 'RCTConvert+AirMap.h' file not found
  18 | #import "AIRGoogleMapPolyline.h"
  19 | 
  20 | @interface AIRGoogleMapPolylineManager()
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolyline.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolygonManager.m
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Codegen' from project 'Pods')
    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Tilleli' from project 'Tilleli')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Tilleli' from project 'Tilleli')
    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
    Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RCT-Folly' from project 'Pods')
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸ 	CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tilleli-fzmqitxhjmwestgpefzrhsophzqr/Build/Intermediates.noindex/ArchiveIntermediates/Tilleli/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapPolylineManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
▸ (1 failure)
** ARCHIVE FAILED **
The following build commands failed:
	CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tilleli-fzmqitxhjmwestgpefzrhsophzqr/Build/Intermediates.noindex/ArchiveIntermediates/Tilleli/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapPolylineManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
(1 failure)
Exit status: 65
+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.210.0                 |
| sdk         | iPhoneOS16.0.sdk        |
+-------------+-------------------------+
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there
[stderr] [!] Error building the application - see the log above
Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.

I'm currently using firebase js package and expo-firebase-analytics with "expo-build-properties" plugins.
image

Can anyone please give me a solution?

@Bilal-Abdeen
Copy link
Contributor

Bilal-Abdeen commented Dec 31, 2022

To be more specific about the additional statements you need to add to your files:

Additional statements need to be added to Podfile:

# Podfile:
...
# Platform should be at least 13.0
platform :ios, '13.0'
# ...

# add the following 2 statements
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'

target 'casualjob' do
	# add the following 2 statements (if not present)
	rn_maps_path = '../node_modules/react-native-maps'
	pod 'react-native-google-maps', :path => rn_maps_path
	# ....

     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
      )
	# ...
        # add the following section
        installer.pods_project.targets.each do |target|
          if target.name == 'react-native-google-maps'
            target.build_configurations.each do |config|
              config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
           end
         end
       end
       # ...
  end

Additional statements need to be added to AppDelegate.mm:

// AppDelegate.mm
// ...
#import "AppDelegate.h"
// ...
// Add the following statement (if not present)
#import <GoogleMaps/GoogleMaps.h>
// ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  // add the following statement (if not present)
  // Replace YOUR_API_KEY below with your project's Google API Key
  [GMSServices provideAPIKey:@"YOUR_API_KEY"];
// ...
}
// ...

For the configuration:

"react": "18.1.0",
"react-native": "0.70.1",
"react-native-maps": "^1.3.2",

@jakobsen9
Copy link

Facing the same issue. After upgraded to SDK47, eas, my IOS builds getting fail. image

Run fastlane section last logs:

› Compiling build Pods/react-native-google-maps » react-native-google-maps-dummy.m
› Compiling react-native-maps Pods/react-native-google-maps » RCTConvert+GMSMapViewType.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapWMSTileManager.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapWMSTile.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapUrlTile.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapURLTileManager.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolylineManager.m

❌  (node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m:17:9)

  15 | #import <React/RCTViewManager.h>
  16 | #import <React/UIView+React.h>
> 17 | #import "RCTConvert+AirMap.h"
     |         ^ 'RCTConvert+AirMap.h' file not found
  18 | #import "AIRGoogleMapPolyline.h"
  19 | 
  20 | @interface AIRGoogleMapPolylineManager()
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolyline.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolygonManager.m
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Codegen' from project 'Pods')
    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Tilleli' from project 'Tilleli')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Tilleli' from project 'Tilleli')
    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
    Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RCT-Folly' from project 'Pods')
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸ 	CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tilleli-fzmqitxhjmwestgpefzrhsophzqr/Build/Intermediates.noindex/ArchiveIntermediates/Tilleli/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapPolylineManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
▸ (1 failure)
** ARCHIVE FAILED **
The following build commands failed:
	CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Tilleli-fzmqitxhjmwestgpefzrhsophzqr/Build/Intermediates.noindex/ArchiveIntermediates/Tilleli/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-google-maps.build/Objects-normal/arm64/AIRGoogleMapPolylineManager.o /Users/expo/workingdir/build/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-google-maps' from project 'Pods')
(1 failure)
Exit status: 65
+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.210.0                 |
| sdk         | iPhoneOS16.0.sdk        |
+-------------+-------------------------+
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there
[stderr] [!] Error building the application - see the log above
Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.

I'm currently using firebase js package and expo-firebase-analytics with "expo-build-properties" plugins. image

Can anyone please give me a solution?

Were you able to solve this within Expo @SohelIslamImran?

@SohelIslamImran
Copy link

@jakobsen9 Try this #4563 (comment)

@jakobsen9
Copy link

@jakobsen9 Try this #4563 (comment)

Thanks, I found this earlier – works like a charm 🙌

@santhosh-umapathi-appymango

Dear @JustineUIT, I hope it's not too late. I'm putting here a fully working Podfile example. Hope also helps who ended up with this discussion further. A briefly key thing to know is the setting pre-installer section in Podfile and marking whole build failing libraries as Static, let's see in example:

# Override Firebase SDK Version
$FirebaseSDKVersion = '8.9.0'

platform :ios, '12.1'

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

# **linkage static is important**
use_frameworks! :linkage => :static
target 'myApp' do
  $static_framework = []
  rn_maps_path = '../node_modules/react-native-maps'

  config = use_native_modules!
  use_react_native!(path: config['reactNativePath'], :hermes_enabled => true)


  # **AUTHOR NOTE:** I didn't try to fix with flipper, we don't want to use anyway. 
       Anybody they would like to try more than welcome
  #  if !ENV['IS_CI']
  #    use_flipper!({
  #      'Flipper' => flipperkit_version,
  #      'Flipper-Folly' => '2.6.10',
  #      'Flipper-DoubleConversion' => '3.2.0',
  #      'Flipper-Glog' => '0.5.0.3',
  #      'Flipper-PeerTalk' => '0.0.4',
  #      'OpenSSL-Universal' => '1.1.1100'
  #    })
  #  end

  # This is the whole magic starts
  # Hit build times and times and which library ever failing add here
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'RNPermissions',
    'Permission-LocationWhenInUse',
    'Permission-Notifications',
    'react-native-paste-input',
    'vision-camera-code-scanner',
    'VisionCamera'
  ]

  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

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

  # This library was the reason we start using use_frameworks! at the beginning
  pod 'RealmSwift', '~>10'
end

target 'OneSignalExtension' do
  pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
  pod 'SwiftyJSON'
end

# ****** THIS IS THE MAGIC ******
pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
        installer.pod_targets.each do |pod|
            if $static_framework.include?(pod.name)
                def pod.build_type;
                Pod::BuildType.static_library # >= 1.9
            end
        end
    end
end

post_install do |installer|
  #  if !ENV['IS_CI']
  #    flipper_post_install(installer)
  #  end

 # This is also important AND MUST BE IN SAME ORDER
  react_native_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'RCT-Folly'
      target.build_configurations.each do |config|
        config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
      end
    end
  end
  #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

Pro tip: after applying this and find all the libraries they needs static library change. Remove Pods one last time and remove DerivedData too

This saved the day !! Thanks a lot.

Here is my version of the podfile,

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Push Notification Setup
use_frameworks! :linkage => :static # With Hermes enabled
$RNFirebaseAsStaticFramework = true


platform :ios, '13.0' # Min iOS version required by Google Maps
prepare_react_native_project!


linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'MyApp' do
  # Google Maps SDK for iOS
  $static_framework = []

  config = use_native_modules!

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

  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.disabled,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  # Google Maps SDK for iOS
  $static_framework += [
    'react-native-maps',
    'react-native-google-maps',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    # 'RNPermissions',
    # 'Permission-LocationWhenInUse',
  ]

  # Google Maps SDK for iOS
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  # The following line is only needed if building on an Apple silicon Mac without rosetta.
  # pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'


  # Important step for Google Maps SDK for iOS 
  pre_install do |installer|
      Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
          installer.pod_targets.each do |pod|
              if $static_framework.include?(pod.name)
                  def pod.build_type;
                  Pod::BuildType.static_library # >= 1.9
              end
          end
      end
  end


  post_install do |installer|
    react_native_post_install(installer)
    # Important step for Google Maps SDK for iOS
    installer.pods_project.targets.each do |target|
      if target.name == 'RCT-Folly'
        target.build_configurations.each do |config|
          config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) ${PODS_ROOT}/fmt/include"
        end
      end
    end
    # Important step for Google Maps SDK for iOS
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    #   __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

@danieldanielecki
Copy link

That was an issue I faced on react-native-maps version 1.4.0, and as per #4563 (comment), upgrading to the newest version fixed the problem.

@virgiliosolano
Copy link

Thank you

lukmccall added a commit to expo/expo that referenced this issue Apr 4, 2024
# Why

Upgrades `react-native-maps` to `1.13.0`

# How

> Note: I couldn't build an iOS project with Google Maps included. I'll take a closer look later. It's a known issue, but the proposed solution didn't work (react-native-maps/react-native-maps#3597). 

# Test Plan

- expo go with NCL ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests