ƒernando Valle
ƒernando Valle

Reputation: 3714

<GoogleMaps/GoogleMaps.h> file not found Google Maps SDK for iOS

Yesterday I recived an email from google saying that I could acces to the map api for ios, I generated my key from the app console and I follow the steps of https://developers.google.com/maps/documentation/ios/start but xcode throw this error.

#import <GoogleMaps/GoogleMaps.h> //file not found

Thanks for your support.

It is normal that appears the Headers executable instead of the folder?

enter image description here

SOLVED!

Upvotes: 10

Views: 60725

Answers (13)

Viren Radadiya
Viren Radadiya

Reputation: 41

To resolve the issue, add the following lines to your Podfile, then run pod install:

  # 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'

If this doesn't work, the issue might be that the min_ios_version_supported environment variable is set to a value lower than 13.4. In that case, change min_ios_version_supported to 13.4, then run pod install again.

Upvotes: 0

ƒernando Valle
ƒernando Valle

Reputation: 3714

1) Extract the subfolder A in version and I renamed it to GoogleMaps.framework

2) Copy this folder to your project folder.

enter image description here

3) Add it to your Frameworks group in the project

enter image description here

4) Import to AppDelegate as #import "GoogleMaps/GoogleMaps.h"

Upvotes: 20

Saad Sheikh
Saad Sheikh

Reputation: 47

Add these lines to your pod file

rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path

pod 'GoogleSignIn', '~> 6.1.0'

after that run pod install

Upvotes: 0

Ranvijay Kumar Singh
Ranvijay Kumar Singh

Reputation: 579

#import <GoogleMaps/GoogleMaps.h>

add above the RCT_NEW_ARCH_ENABLED or Debug in the Appdelegate.m

then add +

[GMSServices provideAPIKey:@"IOS_GOOGLE_MAPS_API_KEY"];

then add the Below Lines into podfile above the use_native_modules!

rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path

This will work

Upvotes: 0

Sadanand
Sadanand

Reputation: 1138

Its better install Pod for google map, Just add google maps into pod. Note if you don't have pod file in your project folder ios/ then do below steps pod init

the add below code in your pod file

platform :ios, '9.0'

target 'YourAppTarget' do
  pod 'GoogleMaps'  # <~~ remove this line if you do not want to support GoogleMaps on iOS
end
# pre_install do |installer|
   # copied from https://github.com/CocoaPods/CocoaPods/issues/2926
   # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
  #  def installer.verify_no_static_framework_transitive_dependencies; end
# end

target 'YourAppTarget-tvOS' do

end

Do not forget to add AirGoogleMaps to your project directory from node_modules/react-native-maps/lib/ios

Upvotes: 0

ManhNguyen
ManhNguyen

Reputation: 121

Maybe you've forgot after change Podfile, you have to run

pod update

then rerun react-native run-ios

Upvotes: 0

iSekhar
iSekhar

Reputation: 119

This answer will also might help you. The above all answers are not worked for me at last after a long time i found like this

# import "GoogleMapsM4B/GoogleMaps.h"

Use like this it definitely solves your problem

Upvotes: -2

Soheil Jadidian
Soheil Jadidian

Reputation: 888

I've been struggling with this issue for hours; I'm using CocoaPods, Swift and Xcode 6.1.1. I followed all the steps for including GoogleMaps in my project carefully, tried many different things like removing symbolic links in the downloaded package or manually linking the binaries in build phases or trying #include "GoogleMaps.h", #include "GoogleMaps/GoogleMaps.h" and "#include <GoogleMaps/GoogleMaps.h> in my bridge file, none of that worked... Finally used CocoaPods instead of including the framework myself and it worked! Hope it helps someone out there:

In the Podfile:

pod 'Google-Maps-iOS-SDK', '~> 1.9.2'

And in your Bridge file:

#import "GoogleMaps.h"

Upvotes: 2

brian.clear
brian.clear

Reputation: 5327

make sure you upgrade to the latest sdk. v1 and v3 were different. had trouble getting v1 to work

Upvotes: 0

Saxon Druce
Saxon Druce

Reputation: 17624

Make sure you unzip the SDK with something which understands symbolic links.

GoogleMaps.framework/Headers is a symbolic link to GoogleMaps.framework/Versions/A/Headers.

When I unzip it on my Mac the symbolic link is set up correctly. But when I unzip it on my PC instead of symbolic links I get text files which just contain the path (eg Versions/Current/Headers).

If you unzip on a PC and then copy the folder to your Mac (or unzip using some other method which doesn't create symbolic links), then you will get the error you see.

Upvotes: 11

nevan king
nevan king

Reputation: 113777

Here's the first few steps you need:

  • Download GoogleMaps-iOS-1.1.0.zip from their site
  • Unzip the file. You now have a GoogleMaps-iOS-1.1.0 folder
  • In that folder you have a GoogleMaps.framework folder.
  • Copy or move the GoogleMaps.framework folder to inside your project folder (in Finder).
  • Drag the GoogleMaps.framework folder onto your Frameworks group in Xcode.
  • In the options sheet, uncheck "Copy items into destination group's folder". Make sure your target is checked in "Add to targets". Click OK.
  • (Note that you can also do this the other way, by not copying it into your project folder and checking "Copy items into destination group's folder". Xcode will copy the folder itself.)

  • Import using #import "GoogleMaps/GoogleMaps.h". The angle bracket usually work too, but in this case it should use quotes.

You should end up with a golden toolbox icon:

enter image description here

Using an #import with angle brackets should search the system frameworks, then inside your project folder, but to be safe try it with quotes.

Upvotes: 3

PGLongo
PGLongo

Reputation: 439

Try this:

Drag the GoogleMaps.framework bundle to the Frameworks group of your project. When prompted, select Copy items into destination group's folder.

You have to copy the unzipped folder "GoogleMaps.framework" into XCode.

Then follow steps 3 & 4

3.Right-click GoogleMaps.framework in your project, and select Show In Finder.

4.Drag the GoogleMaps.bundle from the Resources folder to your project. We suggest putting it in the Frameworks group. When prompted, ensure Copy items into destination group's folder is not selected.

If still not working try adding manually GoogleMaps.framework in the Build Phases tab->Link Binary with Libraries

Upvotes: 8

Areal-17
Areal-17

Reputation: 406

the GoogleMaps framework is probably not in the Library folder but in the same directory like all other project files. I this case you have to write #import "GoogleMaps/GoogleMaps.h or #import "GoogleMaps.h"

Upvotes: 1

Related Questions