Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native ios 'GoogleMaps/GoogleMaps.h' file not found

I got a problem with my app.

When I try to build it on Android Studio everything works fine but when I try to build it on Xcode I got an error and the build fails.

The reason seems to come from AirMaps:

Lexical or Preprocessor Issue

'GoogleMaps/GoogleMaps.h' file not found

AIRGoogleMapUrlTile.h

It's strange because it worked fine until now and I can't find why.

I'm using:

- "react": "16.0.0-alpha.6",
- "react-native": "0.43.3",
- "react-native-maps": "^0.21.0"

and here is my Podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'

target 'Situaction' do
  rn_path = '../node_modules/react-native'
  rn_maps_path = '../node_modules/react-native-maps'

  pod 'Fabric'
  pod 'Crashlytics'

  pod 'GoogleMaps'
end

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
    if target.name == "React"
        target.remove_from_project
    end
  end
end

Can you help me please,

Thanks in advance

EDIT:
here are the header search paths. Header Search Paths

like image 232
Mathieu Lemerre Avatar asked Jun 13 '18 12:06

Mathieu Lemerre


1 Answers

If you are using React Native 0.60 and higher, add the following to your Podfile above the use_native_modules! function and run pod install in the ios folder:

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

visit the documentation

like image 194
mcnk Avatar answered Nov 15 '22 05:11

mcnk