iOS Error: Compiling react-native-maps Pods/react-native-google-maps - AIRGoogleMapPolylineManager.m

I get an error in my managed workflow iOS build:

› 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

❌  (node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolyline.h:12:9)

  10 | #import <React/RCTBridge.h>
  11 | #import "AIRGMSPolyline.h"
> 12 | #import "AIRMapCoordinate.h"
     |         ^ 'AIRMapCoordinate.h' file not found
  13 | #import "AIRGoogleMapMarker.h"
  14 | 
  15 | @interface AIRGoogleMapPolyline : UIView

I have installed "react-native-maps": "0.31.1" with the expo cli. Do I need to install a new version?

I also saw other error logs inside this build step, but they seem to be unimportant.

[stderr] 2022-10-05 12:07:49.883 xcodebuild[4721:17403] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition

are you using react-native-firebase and have useFrameworks enabled in expo-build-properties? if so, this may cause some issues as i believe react-native-maps is not currently compatible with that

Yes - I use that. So currently there is no way to operate both at the same time?

Using a newer react-native-maps version supporting the property throws another error:

[!] CocoaPods could not find compatible versions for pod "react-native-google-maps":
  In Podfile:
    react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)
Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.
Error: Compatible versions of some pods could not be resolved.
You are seeing this error because either:
  - Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with "--clear-cache" option, or select "Clear cache and retry build" on the build page.
  - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.

Hey @brents do you know by any chance how I can solve this problem now? Do I need to create an issue or something?

it was fixed in react-native-maps: fix(ios): add header paths required for use_frameworks compilation · react-native-maps/react-native-maps@e98be83 · GitHub

this made it into version 1.3.2. you can upgrade to that version and it should work fine, but you will see warnings because we haven’t tested it against sdk 46. you can ignore the warnings if it works for you.

I already tried that and got the error mentioned above.

You are seeing this error because either:
  - Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with "--clear-cache" option, or select "Clear cache and retry build" on the build page.
  - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.

did you try this?

Well, I can’t really do that manually in the managed workflow… but I wrote a plugin that inserts two new lines in the Podfile like this:

  pod 'react-native-google-maps', path: File.dirname(`node --print "require.resolve('react-native-maps/package.json')"`)
# Add the required versions from node_modules/react-native-maps/react-native-google-maps.podspec
  pod 'GoogleMaps', '7.0.0' 
  pod 'Google-Maps-iOS-Utils', '4.1.0'

I also replace the platform version with platform :ios, '13.0' to match the one from react-native-google-maps.

And for the problem with the cache, I already tried running eas build --profile development --platform ios --clear-cache aswell.

Question
Is the plugin with withDangerousMod executed before the generation of the Podfile.lock? If not, how can I modify the Podfile before it’s getting installed?

i think you might be misunderstanding the error message.

Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with “–clear-cache” option, or select “Clear cache and retry build” on the build page.

this is a specific error message to eas build. you can re-run eas build --clear-cache or from the build page press “Clear cache and retry build”

I tried running --clear-cache and rebuilding in the build page, and none of both solved the problem. Still getting the issue with the latest version of react-native-maps (^1.3.2).

[!] CocoaPods could not find compatible versions for pod "react-native-google-maps":

20

  In Podfile:

21

    react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)

22

Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.

23

Error: Compatible versions of some pods could not be resolved.
You are seeing this error because either:
  - Versions in the cached Podfile.lock do not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with "--clear-cache" option, or select "Clear cache and retry build" on the build page.
  - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.

Did you fix the problem?

you may need to bump the minimum deployment target if you get this in the error msg:

Specs satisfying the react-native-google-maps (from /Users/expo/workingdir/build/node_modules/react-native-maps) dependency were found, but they required a higher minimum deployment target.

you can use expo-build-properties to set it: BuildProperties - Expo Documentation

1 Like

Yeah I did. If someone from the future still gets the error, check your eas.json file, I forgot to update the version lol.

@brents BTW, I think there is an incompatibility when using EAS + Expo 46 + react-native-maps + firebase + expo-firebase-analytics.

  1. firebase and expo-firebase-analytics require static ‘useFrameworks’
  2. In order to be able to compile, we need to upgrade react-native-maps to v1.3.2, in which the header paths required for useFrameworks compilation are included.
  3. This version introduces a new build failure, in ‘react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m:17:9’, since the file ‘RCTConvert+AirMap.h’ doesn’t exist.

this is not an incompatibility with eas build - this service just runs your builds. the incompatibility exists between firebase and maps, which are external libraries

1 Like

@notbrent Hey brent. I have tried with the beta of Expo SDK 47 and the problem persists. I have decided to use a custom config plugin to fix this but I need to access @expo/config-plugins/build/utils/generateCode (just to use the mergeContents utility function).

The official documentation says the following:

The @expo/config-plugins and @expo/config packages are re-exported from the expo package starting in SDK 47.

Is there a way to import mergeContents directly from the expo package?

the easiest way to do that is to just copy the source file over: expo/generateCode.ts at main · expo/expo · GitHub

we haven’t committed to making this a public api so ymmv in depending on it from the expo pkg

After battling this issue for days my team agreed to just use default ios map on ios devices rather than try to use google maps on ios. At least until the issue is well resolved.

The disadvantage of this is that we do not have a unified map for both platforms, but we can manage with this as we are only using the map to display markers and nothing more.

To use Google Maps on ios requires much tweaking of code files (Podfile, app.json, AppDelegate.m, Info.plist) and still yet the issue was not resolved, but yielding other errors.

By using PROVIDER_DEFAULT in our MapView provider props, there is no need for any additional configuration.

@omoaram it seems others have got it working with RN Maps 1.3.2 and the following config plugin: use_frameworks! issues with react-native-maps RN 0.69.3 · react-native-maps/react-native-maps · Discussion #4389 · GitHub

e.g. here’s another thread about this

You should not have to change AppDelegate.m or Info.plist and the Podfile changes are handled by the config plugins.

@wodin thanks for your reply. we would try the config plugin

"@react-native-firebase/app",
        "@react-native-firebase/perf",
        "@react-native-firebase/crashlytics",
        "./withReactNativeMaps",

as that is the only approach we did not try amongst all the various solutions we found on many forums