Yes
Yes
react: 16.3.0
react-native: 0.54.4
react-native-maps: 0.21.0
iOS only, without Google Maps
The build succeeds.
The iOS build crashes with AIRGoogleMapCircle.h:7:9: fatal error: 'GoogleMaps/GoogleMaps.h' file not found
even if I do not use Google Maps.
The cause is commit https://github.com/react-community/react-native-maps/commit/d22f96f9115f10b50085206463143c421f8d948d where some Google-depending sources have been added to AirMaps.xcodeproj/project.pbxproj
.
For now I got things moving again with a npm postinstall script that deletes the references:
"postinstall": "sed -i '' '/Google.*\\.[h|m]/d' node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj/project.pbxproj"
I expect that any iOS project that does not use Google Maps will have the same problem.
@radubatori did you remove from podfile all the Google references as per installation instructions?
You might also need to clean your xcode project and run pod install again if you had the google refs on before.
I did not use Google Maps from the start, so the podfile does not reference 'react-native-google-maps' or 'GoogleMaps'.
The same result is obtained if I do not use pods and add AirMaps as a library directly.
@rafaellincoln could you please have a look? 馃
I just upgraded from 0.20.1 to 0.21.0 and am also having problems.
Environment
react: ^16.3.0-alpha.1
react-native: 0.54.4
react-native-maps: 0.21.0
iOS, without Google Maps
Screenshot
@radubatori I could not simulate the error, can you help me simulate this error?
I created a repository to perform the tests.
https://github.com/rafaellincoln/rn-maps-ios
Thank you for your support, but meanwhile I had to downgrade to 0.20.1 because of gradle 4 incompatibilities with some of my project's dependencies.
Still, I suspect the issue occurs only when having the AirMaps library linked directly and I somehow missed that during the upgrade. However, even if this installation mode is not officially supported, it still works fine with version 0.20.1 (at least if you do not use Google Maps), so it is possible this issue will prevent users that do not wish to use pods from upgrading.
Thank you again for your support, I will close this issue until I attempt to upgrade again and have a clean repository where the issue can be reproduced.
Should I open an issue of my own? I'm not sure if the bug i'm experiencing is the same or different.
@TheWrongAlice If running sed -i '' '/Google.*\\.[h|m]/d' node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj/project.pbxproj
(macos) will fix your problem, then it's probably the same issue.
I ran into the same issue using:
react: 16.3.0
react-native: 0.54.2
react-native-maps: 0.21.0
without having the GoogleMaps headers configured for iOS. Fixed by applying the.patch
file below to react-native-maps
tag v0.21.0
during postinstall. I'm not using Pod yet.
https://gist.github.com/meylor/442cf17ae6ff6213b358866dde4f5b77
To use the patch, copy the file above to node_modules/react-native-maps
and run patch -p1 < react-native-maps-remove-google-support.patch
The sed command didn't fix the issue for me.
@meylor I got some type of error running that patch. Now I got 33 new build errors. Did I use it wrong?
project_root$ cd node_modules/react-native-maps/
project_root/node_modules/react-native-maps$ patch -p1 < react-native-maps-remove-google-support.patch
patching file ./lib/ios/AirMaps.xcodeproj/project.pbxproj
patch unexpectedly ends in middle of line
Hunk #4 succeeded at 240 with fuzz 1.
Can you reopen this ticket? I'm also having this problem. The sed line that @radubatori suggests does fix this problem for me. (@radubatori you should remove one of the backslashes in your sed line)
I've reopened the issue, but I cannot provide a clean environment to reproduce it.
@arichnad The extra backslash is there to escape the backslash in package.json
. If the command is ran directly, then yes, one backslash has to be removed.
@TheWrongAlice are you using react-native-maps: 0.21.0
?
@meylor Yes that's right.
@TheWrongAlice here are the versions from my package.json
{
"name": "MobileApp",
"version": "0.0.1",
"private": true,
"scripts": {
"postinstall": "scripts/postinstall.sh",
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.3.0",
"react-native": "0.54.2",
"react-native-maps": "0.21.0"
...
},
"devDependencies": {
...
},
"jest": {
"preset": "react-native"
}
}
postinstall.sh is is just doing patch -p1 < $patchfile
; perhaps you're not having the same issue?
@meylor I got your solution to work now (I guess I was doing something wrong the first time).
My build is succeeding! :balloon:
I hope that this can be fixed in the master branch soon.
@radubatori @rafaellincoln @meylor could you guys collaborate and make a PR to solve this issue 馃 鉂わ笍
@TheWrongAlice what were you doing wrong? i have the same problem like you. im getting
Helmers-Mac:react-native-maps helmer$ patch -p1 < react-native-maps-remove-google-support.patch
patching file ./lib/ios/AirMaps.xcodeproj/project.pbxproj
patch unexpectedly ends in middle of line
Hunk #4 succeeded at 240 with fuzz 1.
@hlbp I do still get the "unexpectedly ends in middle of line" but it seems harmless as I am still able to build my application in Xcode. I think I just needed to do a Clean and delete my build folder (rm -rf ios/build
) and then it worked :)
Same issue here, using the patch mentioned by @meylor fixed it for me.
@JCMais make a PR with the fix?
@rborn @rafaellincoln I can try to take a look at making a PR this weekend. I don't think that removing the AirGoogleMaps dependencies from project.pbxproj
is the right approach since someone may actually want to use GoogleMaps on iOS. I'm guessing that most people are having an issue because they're not using CocoaPods, which is a requirement in the installation instructions.
Simple solution should be to add instructions for manually adding the GoogleMaps header files. I haven't yet looked at the source, but it seems odd that the default behavior for not using GoogleMaps is to not have the Pod dependencies, which are a requirement in the project.pbxproj
file.
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # Remove this line if you don't want to support GoogleMaps on iOS
pod 'GoogleMaps' # Remove this line if you don't want to support GoogleMaps on iOS
pod 'Google-Maps-iOS-Utils' # Remove this line if you don't want to support GoogleMaps on iOS
One way to not use GoogleMaps only from CocoaPods, is to use ${inherited} on the header / framework search paths.
If that was included it would be possible to simple add the framework directly and set their path on the settings of the app.
I'm using without cocoapods, after upgrade to 0.21.0 this problem appears.
Its possible to fix without cocoapods?
Is there any installation instructions for people who do not use cocoapods?
Cann't get the new version work in ios because of the GoogleMap.h not fount error.
Or, does anyone who managed to work by manually installing GoogleMap SDK?
remove all google maps reference in build phases -> compile source in Librairies/AirMap/Build Phases
@hamsddxn this solution means it needs to be done every time yarn install re-installs libraries and it will not work for CI-s.
I use cocoa-pods in my projects but I prefer to keep react-native out of it so far, as there are other libraries that depend on react and don't support cocoapods (react-native-navigation is one of them).
I would love to see some installation instructions that do not require CocoaPods. No matter how complicated they may be.
I tried to install without cocoapod and manually install GoogleMap SDK(because I want to use google map), but it's really not good, it wasted me a lot of time.
the point is that you have to install google-maps-ios-utils to use react-native-map(otherwise you will get errors) but that utils doesnot have manual installation instructions except cocoapod.
so finally I have to use cocoapod to use this library.
We managed to get it installed without CocoaPods!
cc: @theonetheycallneo maybe we could share what we did with this thread to help others looking to do a pure manual install.
@duro would love to see manual install instructions sans cocoa pods cc @theonetheycallneo
@duro yes please share your experience !
Hey guys, I've posted a public gist for all:
https://gist.github.com/theonetheycallneo/bea215ebfbc7d7ade422458f60760df1
@Freddy03h @zzimbler read above^^ let me know what you think!
@theonetheycallneo, Does this tutorial work with Apple Maps, or just with Google Maps?
@theonetheycallneo Hi!
I tried your instruction, but maybe something missed.
What I am doing.
question: what means the line $(SRCROOT)/Frameworks/Google-Maps-iOS-Utils
in this step?
Frameworks
and it contains libReact.a
, so I added GoogleMaps.framework
, GoogleMapsCore.framework
and GoogleMapsBase.framework
from unzipped ios sdk folder. Drag this three frameworks to Embedded Binaries
notice: I noticed, that after that, there were no changes in Build Phases/Compile Sources
, it contains only main.m
and AppDelegate.m
.
question: What it means? I dont have a folder
Google-Maps-iOS-Utilsin xcode
Frameworks`.
$(SRCROOT)/Frameworks/Google-Maps-iOS-Utils
Frameworks
folder in xcode. You could see it in left sidebar in above screenshot.$(GITROOT)/node_modules/react-native-maps/lib/ios/AirGoogleMaps
$(GITROOT)/node_modules/react-native-maps/lib/ios/AirMaps
notice: In Build Phases/Compile Sources` there are a lot of files after step 4.
But I got an error:
I research a problem and found that this is a dependency from https://github.com/googlemaps/google-maps-ios-utils but I don`t have it. How I could install it?
This issue looks like a duplicate of https://github.com/react-community/react-native-maps/issues/2270.
I opened a PR at https://github.com/react-community/react-native-maps/pull/2310 which coincidentally appears to implement the same patch that @meylor came up with, please test it to see if it fixes this issue for y'all!
@radubatori The gradle 4 issue you mentioned sounds like it could be https://github.com/facebook/react-native/issues/16906
Hi, so is there a work around? I saw a few mentions of removing AirGoogleMaps from AirMaps.xcodeproj. What is the correct way to do this? I assume I have to do it in xcode? Thanks!
@billtlee
@radubatori suggested a workaround himself.
I automated it (for CI etc.) by having this in the package.json
:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"postinstall": "cross-os fix-maps"
},
"cross-os": {
"fix-maps": {
"darwin": "sed -i '' '/Google.*\\.[h|m]/d' node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj/project.pbxproj"
}
},
and of course npm install -S cross-os
It basically removes all references to Google Maps in the faulty AirMaps.xcodeproj/project.pbxproj
@dj-hedgehog Thx!
@meylor the gist worked for me.
The project succeeded to build.
But It gives me error while archiving. Any suggestion?
Please keep in mind that you might have to setup the module again as now it works with react-native link
Read the install manual carefully
@dj-hedgehog worked ! thx !
Add pod 'GoogleMaps', '~> 2.7.0' and then pod install solves the problem
@nolan12345 it doesn't work.
Solution by @dj-hedgehog is awsome! :+1:
nothing has worked for me so far :(
Most helpful comment
I ran into the same issue using:
without having the GoogleMaps headers configured for iOS. Fixed by applying the
.patch
file below toreact-native-maps
tagv0.21.0
during postinstall. I'm not using Pod yet.https://gist.github.com/meylor/442cf17ae6ff6213b358866dde4f5b77
To use the patch, copy the file above to
node_modules/react-native-maps
and runpatch -p1 < react-native-maps-remove-google-support.patch
The sed command didn't fix the issue for me.