Google Maps SDK for iOS requires GoogleMaps.bundle to be part of your target under 'Copy Bundle Resources

IosIphoneXcodeGoogle MapsGoogle Maps-Sdk-Ios

Ios Problem Overview


When I build a GoogleMaps SDK for iOS,these error occurred.

*** Terminating app due to uncaught exception 'GMSException', reason: 'Google Maps SDK for iOS requires GoogleMaps.bundle to be part of your target under 'Copy Bundle Resources''

but,GoogleMaps.framework is in copy bundle resources.so,I'm confused.please tell me cause of this problem.

Ios Solutions


Solution 1 - Ios

The instructions are kinda lacking. I hope this helps...

  1. Launch Xcode (easy)

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

  3. Right-click GoogleMaps.framework in your project, and select Show In Finder. What it doesn't say is...Then go into the child folder called Resources

  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.

Solution 2 - Ios

To the 2017 people searching on SO, the easiest way is indeed try the installing and updating your pod by of course pod install and pod update. Then finally, clean the project and the build by these two commands:

  1. Clean Build: Command + alt option + Shift + K
  2. Clean Project: Command + Shift + K

Then voila! Crash won't happen again.

Solution 3 - Ios

If you are experiencing this issue in a more recent version of this framework and are using the CocoaPods deployment, then check that the "Copy Pods Resources" section of "Build Phases":

enter image description here

Apparently this section going missing is a thing and deleting your Pods directory and re-running "pod install" isn't sufficient to fix it. Instead you will need to grab this handy tool:

https://github.com/CocoaPods/cocoapods-deintegrate

Run this thing and then re run pod install and your "Copy Pods Resources" section should be back and you won't get this exception when you instantiate your map.

Solution 4 - Ios

For those of you trying this out in 2017 with Xcode 9 (first release) and the new build system, the following resolved this for me.

Note: The fundamental issue seems to be that the new build system is NOT cleaning properly, so you need to switch back to the old system. Also as of 9/25/17 the google place picker is calling UI off the main thread and is throwing errors in Xcode.

-Switch to old build system

-click your project file "My App Name"

-Under "TARGETS" click your app name (not tests or UITests!)

-build phases

-[CP] Copy Pods Resources

-You should see ${PODS_ROOT}/GoogleSomething , select those and hit -

-Close Xcode, run pod install.

-Open Xcode, Command-Shift-K (clean, and MAKE SURE YOU'RE ON THE OLD BUILD SYSTEM!)

-Build/Run, should work now

Solution 5 - Ios

running "pod install" fixed this issue for me.

Solution 6 - Ios

If you installed the map via CocoaPods Try the following steps.

  1. Go to TARGETS > Build Phases
  2. Disable 'Run script only when installing' enter image description here

Solution 7 - Ios

For Me i have the same issue in the manual installation.

1.right-click GoogleMaps.framework in your project, and select Show In Finder .

  1. double click or Open this GoogleMaps.framework. we can able to see the Folder "Resources" . (i have added the image Screen Shot for the where GoogleMaps.bundle available)
  2. click the Resources folder we can find the GoogleMaps.bundle

enter image description here

  1. now just Drag and Drop the GoogleMaps.bundle into your project. ensure Copy items into destination group’s folder is not selected. enter image description here

Note: ensure "Copy items if Needed" destination group’s folder is not selected. see the Screen shot too.

now Clean the Command+Shift+K or Xcode-->Product--> Clean

this may helps to someone.

Solution 8 - Ios

I was facing same issue, do the following:

1. Go to derived folder and delete the project folder
2. Clean build and run

Fixed the issue

Solution 9 - Ios

Terminating app due to uncaught exception 'GMSException', reason: 'Google Maps SDK for iOS requires GoogleMaps.bundle to be part of your target under 'Copy Bundle Resources'

  1. find GoogleMaps.bundle in GoogleMap.frameword/Resources you will see GoogleMap.bundle
  2. Drag GoogleMaps.bundle into Base/Framework with GoogleMapsBase.framework

hope this can help. Thanks

Solution 10 - Ios

Once I updated to Xcode 9 Swift 3.2 I kept getting a crash inside AppDelegate at this line:

GMSServices.openSourceLicenseInfo()

I kept using Glenn's answer to clean the project which definitely worked but eventually the crash kept happening.

To solve it I had to follow the directions in Google Maps API Installation

Follow:

Step 2: Install the SDK and Install Manually

This is very easy to do but 1 thing sort of confused me at first so I'm adding it in for clarity for the next person:

Once your read the manual instructions and on number 4 it says:

4. Drag the following bundles into your project (when prompted, select Copy items if needed): 

enter image description here

The thing is inside the zip file that you download, once you unpack it there are only going be 2 frameworks inside of it:

GoogleMaps.framework
GoogleMapsCore.framework

There won't be a GoogleMapsBase.framework. I'm assuming they bundled it into the GoogleMaps.framework?

Once you get to number 8: Open the Build Phases tab, and within Link Binary with Libraries, add the following frameworks:. It lists a number of frameworks that you have to import.

enter image description here

The problem is the first 3 that are listed that it says to add were already added (actually two of them were added -GoogleMaps.framework and GoogleMapsCore.framework) when you unpacked that zip file and dragged them into your project.

I kept typing in the names and nothing would show up.

enter image description here

I kept deleting all the Google frameworks, starting from the beginning, and trying again until I realized they already existed. Basically type in the names of everything from Accelerate.framework - UIKit.framework and you should be good.

Solution 11 - Ios

This way I have fixed my issue.

 1. Delete the derived folder.
 2. pod update
 3. Clean Project and build.

Thats all

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnyDgoodeView Question on Stackoverflow
Solution 1 - IossberleyView Answer on Stackoverflow
Solution 2 - IosGlenn PosadasView Answer on Stackoverflow
Solution 3 - IosRedBlueThingView Answer on Stackoverflow
Solution 4 - Iosuser8671173View Answer on Stackoverflow
Solution 5 - IosAbdul HannanView Answer on Stackoverflow
Solution 6 - IosSreeraj VRView Answer on Stackoverflow
Solution 7 - IosMurugan MView Answer on Stackoverflow
Solution 8 - IossahiljainView Answer on Stackoverflow
Solution 9 - IosChea SambathView Answer on Stackoverflow
Solution 10 - IosLance SamariaView Answer on Stackoverflow
Solution 11 - IosTunvir Rahman TusherView Answer on Stackoverflow