react-native-maps: CocoaPods could not find compatible versions for pod "GoogleMaps":

Bug report

Hi!

I updated to RN 0.62.2 and also updated react-native-maps to the latest version (0.27.1) and got the following error:

[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
  In Podfile:
    GoogleMaps

    react-native-google-maps (from `../node_modules/react-native-maps`) was resolved to 0.27.1, which depends on
      GoogleMaps (= 3.5.0)

    react-native-google-places (from `../node_modules/react-native-google-places`) was resolved to 3.1.2, which depends on
      GoogleMaps (~> 3.1.0)

I tried running pod update with no success. Also deleted pods, cleared cache and ran pod install and still had this conflict. Any ideas? I am not really savvy about Pods.

Podfile

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 11
  • Comments: 25

Most upvoted comments

image Change this in the Xcode and in Podfile

run pod repo update then run pod install again

after a lot of trials i found a solution, somehow react-native-google-places GoogleMaps version was conflicting with react-native-maps so i had to apply a patch to update it to GoogleMaps version 3.5.0

link to the patch https://gist.github.com/L0rdCr1s/b955c35ba2c467b8a01d13750be43d80

i used patch-package to apply it, if you don’t know how to use it like i didn’t, create a folder called patches on the root of your project directory and then paste the .patch file from the link.

after that install patch-package by running yarn add --dev patch-package postinstall-prepare after installing run yarn patch-package

if everything went well pod install should work fine now

hope this helps someone

I solved it like this:

  • I checked my node_modules/react-native-maps/react-native-google-maps.podspec and I have the following versions:
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
...
  s.dependency 'GoogleMaps', '5.1.0'
  s.dependency 'Google-Maps-iOS-Utils', '3.10.3'
...
  • then I updated my Podfile like this:
    rn_maps_path = '../node_modules/react-native-maps'
    pod 'react-native-google-maps', :path => rn_maps_path
    pod 'GoogleMaps', '5.1.0' # <<<<---- I added the '5.1.0' version here
    pod 'Google-Maps-iOS-Utils', '3.10.3' # <<<<---- I added the '3.10.3' version here
  • I ran pod install and I got this error: [!] The platform of the target inguru(iOS 10.0) may not be compatible withGoogleMaps (5.1.0) which has a minimum requirement of iOS 11.0.
  • I updated the minimum required build version to 11.0 on top of my Podfile:
platform :ios, '10.0'
  • I ran pod install again and everything worked.

delete your Podfile.lock and reinstall

In the Podfile you can find the line “platform :ios, 13.4”. change the iOS version as in the node_modules/react-native-maps/react-native-google-maps.podspec IOS version

Inside <app>/ios/Podfile find the line which has pod 'GoogleMaps' and change it to, pod 'GoogleMaps', '3.5.0'. The version number can be different for different projects. Mine was 3.5.0 as described in the error message.

After the change, run pod install and you’re good to go. Note that for M1 Macs, use $ sudo arch -x86_64 gem install ffi $ arch -x86_64 pod install

pod update GoogleMaps worked for me to upgrade to 3.5.0. Might need to run pod repo update first

I followed the suggestion from @NachoJusticia , but I need to run pod install --repo-update to apply the version specifications.

I am using:

React-Native: v0.73.2
Node - 18.19.0
Yarn: 1.22.21
Cocoapods: 1.15.0
Xcode 15.2

And I tried to use "react-native-maps": "^1.7.1"

This is my case:

Screenshot 2024-01-30 at 18 13 03

[!] CocoaPods could not find compatible versions for pod “react-native-google-maps”: In Podfile: react-native-google-maps (from ../node_modules/react-native-maps)

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

After changing the minimum deployment target version to 13.4, I can run it.

go to you Podfile update platform :ios, ‘10.0’ to platform :ios, ‘13.0’ and then install pod

I deleted Pods folder, Podfile.lock and node_modules folder then did yarn install but when I do pod install I get this error

Auto-linking React Native modules for target `customerapp`: RNCAsyncStorage, RNCMaskedView, RNDateTimePicker, RNGestureHandler, RNPermissions, RNReanimated, RNSVG, RNScreens, RNVectorIcons, ReactNativeLocalization, lottie-react-native, react-native-geolocation, react-native-google-places, react-native-maps, react-native-netinfo, react-native-onesignal, react-native-safe-area-context, react-native-splash-screen, and react-native-webview
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
  In Podfile:
    react-native-google-maps (from `../node_modules/react-native-maps`) was resolved to 0.27.1, which depends on
      GoogleMaps (= 3.5.0)

    react-native-google-places (from `../node_modules/react-native-google-places`) was resolved to 3.1.2, which depends on
      GoogleMaps (~> 3.1.0)

Specs satisfying the `GoogleMaps (= 3.5.0), GoogleMaps (~> 3.1.0)` dependency were found, but they required a higher minimum deployment target.

and pod update GoogleMaps doesn’t work without Podfile.lock

If someone got this type of issue in 2023, deleting package-lock.json followed by podfile.lock might help. If still issue is not resolved for you, look for ^(caret) sign before react-native-maps in package.json and remove it. And then try npm install & pod install

I deleted dependencies versions in node_modules/react-native-maps/react-native-google-maps.podspec

s.dependency ‘React-Core’ s.dependency ‘GoogleMaps’ s.dependency ‘Google-Maps-iOS-Utils’

It works for me