Reputation: 1563
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.
Upvotes: 72
Views: 44290
Reputation: 2248
The instructions are kinda lacking.
Launch Xcode (easy)
Drag the GoogleMaps.framework bundle to the Frameworks group of your project. When prompted, select Copy items into destination group's folder.
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
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.
Upvotes: 182
Reputation: 6641
This way I have fixed my issue.
1. Delete the derived folder.
2. pod update
3. Clean Project and build.
Thats all
Upvotes: 0
Reputation: 175
For Me i have the same issue in the manual installation.
1.right-click GoogleMaps.framework in your project, and select Show In Finder .
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.
Upvotes: 3
Reputation: 2374
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
Upvotes: 2
Reputation: 19622
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):
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.
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.
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.
Upvotes: 1
Reputation: 1572
If you installed the map via CocoaPods Try the following steps.
Upvotes: 4
Reputation: 71
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
Upvotes: 7
Reputation: 13300
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:
Command + alt option + Shift + K
Command + Shift + K
Then voila! Crash won't happen again.
Upvotes: 89
Reputation: 1335
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'
GoogleMaps.bundle
in GoogleMap.frameword/Resources
you will see GoogleMap.bundleGoogleMaps.bundle
into Base/Framework
with GoogleMapsBase.frameworkhope this can help. Thanks
Upvotes: 1
Reputation: 42532
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":
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.
Upvotes: 8