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
run
pod repo updatethen runpod installagainafter 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
patcheson the root of your project directory and then paste the.patchfile from the link.after that install patch-package by running
yarn add --dev patch-package postinstall-prepareafter installing runyarn patch-packageif everything went well
pod installshould work fine nowhope this helps someone
I solved it like this:
node_modules/react-native-maps/react-native-google-maps.podspecand I have the following versions:Podfilelike this:pod installand I got this error:[!] The platform of the targetinguru(iOS 10.0) may not be compatible withGoogleMaps (5.1.0)which has a minimum requirement of iOS 11.0.11.0on top of myPodfile:pod installagain 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/Podfilefind the line which haspod '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 installand you’re good to go. Note that for M1 Macs, use$ sudo arch -x86_64 gem install ffi$ arch -x86_64 pod installpod update GoogleMapsworked for me to upgrade to 3.5.0. Might need to runpod repo updatefirstI followed the suggestion from @NachoJusticia , but I need to run
pod install --repo-updateto apply the version specifications.I am using:
And I tried to use
"react-native-maps": "^1.7.1"This is my case:
[!] 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
and
pod updateGoogleMaps doesn’t work without Podfile.lockIf 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 installI 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