React Native 'GoogleMaps/GoogleMaps.h' file not found in AppDelegate.m:

Viewed 350

Environment info "react": "17.0.2", "react-native": "0.66.3" "react-native-maps": "^0.29.4"

XCode Version 13.1 (13A1030d) macOS 12.0.1 Target Platform iOS 15.1 Phone using GoogleMaps

Steps to reproduce Create new project Add config = use_native_modules! in the Podfile Add in the Podfile:

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'

pod install

Add in AppDelegate.m:

#import "AppDelegate.h"
#import <GoogleMaps/GoogleMaps.h>
#import <GooglePlaces/GooglePlaces.h>
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary
*)launchOptions
{
[GMSServices provideAPIKey:@"xxxx"];
[GMSPlacesClient provideAPIKey:@"xxxx"];
}

Build in XCode

Describe what you expected to happen:

Build successful

Describe what you actually happens:

/ios/UbiWalkerReactNat/AppDelegate.m:2:9: 'GoogleMaps/GoogleMaps.h' file not foundenter image description here

2 Answers

you need to first import import <GoogleMaps/GoogleMaps.h> in AppDelegate.m see here.

Seems to be solved, there was a WARNING on pod install: [!] The xxx [Debug] target overrides the FRAMEWORK_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-xxx-xxx/Pods-xxx-xxx.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or

  • Remove the build settings from the target.

I've SOLVED with $(inherited) flag on Build Settings.

Related