سؤال

I've implemented the "Getting the Google Maps SDK for iOS" step by step

finally the simulator running ok no errors found but the map has no details except the marker.

As showing in the picture:

Screnshot of simulator

Also the output on the bottom has this message:

2012-12-23 01:06:59.869 GogleMap[3680:c07] GMSZoomTableQuadTree lacks root zoom table for >tile type (mapType: 10) 2012-12-23 01:07:00.042 GogleMap[3680:1b03] Google Maps SDK for iOS version: 1.0.1.1154 2012-12-23 01:07:00.375 GogleMap[3680:c07] ClientParametersRequest failed, 3 attempts >remaining. Error Domain=DASHConnectionError Code=100 "The operation couldn’t be completed. (DASHConnectionError error 100.)"

Help please and thanks in advance.

هل كانت مفيدة؟

المحلول 2

@user1924208 I am having the same issue. I have searched the internet tirelessly for the answer and unfortunately I think we are out of luck. The Google API Console is probably showing you the API key for Google Maps v.3 which is NOT the Google Maps iOS API key. Therefore when you use that as your API key, the validation request will always fail.

It seems as if they haven't issued many API keys for the iOS version for whatever reason. As frustrating as it is, you will just need to wait until you receive an email from them (not really sure when that will be...).

You can confirm this because replacing the current API key with any random string will produce the same results. By the way, this also produces the same results both on simulator and on a real device, which I have tested.

Update

I just got an email from Google Maps that my API key is now available. I switched out the MKMapKit with GMSServices and things are working. It seems like they are a little more comfortable with releasing API keys now so hopefully you will get yours very soon.

نصائح أخرى

Solved: I think we've all skipped a small but very important step in the process.

To get started, enable the Google Maps SDK for iOS service in the Google APIs Console alongside other Google APIs.

enter image description here

Once you enable GoogleMap SDK for iOS in the Google APIs Console, your app will correctly load the tiles on the next run. Good luck!

Heads up, make sure you've also enabled "Google Maps SDK for iOS" in the Services tab.

I was getting a similar error till I realized I had only generated an API key but forgot to enable the service. Solved my issue.

SDKDemos[160:907] ClientParametersRequest failed, 0 attempts remaining (0 vs 5). 
Error Domain=com.google.Maps.GMSDASHConnection Code=100 
"The operation couldn’t be completed. (com.google.Maps.GMSDASHConnection error 100.)"

I had a similar problem, but I was sure that the API key was good because the example project from the SDK package worked with that key - bundle ID pair I used in the actual app. The latest (1.2) version of the sdk actually logs out a warning if your API key does not seem to be valid. The reason it failed to display the map was that I did not fill in a build number in target summary tab of the project settings. Turns out you absolutely need to have CFBundleVersion set in your Info.plist for the google map to work, otherwise the map just stays blank with no errors or warnings shown or even web requests being made.

I had same problem. I think the problem is my "bundle indentifier" of my project is different from one of bundle identifiers in my Google APIs Console.

So I add more bundle indentifer for my Google APIs Console: select your project itself from the Project Navigator, and choose your application's target. In tab Summary, remember your string in Bundle Identifier.

Go to Google APIs Console page, select API Access pane in the console, locate the section Key for iOS apps, select Edit allowed iOS apps...and add your bundle indentifer that you remember above. Rerun your project and done!

Just make sure Location is enable from

Simulator options Features->Location->Apple

enter image description here

I was having the same problem, then i went to the google console and clicked on "Generate new key" and the the new key Worked!

Make sure you havn't changed your

[bundle identifier]

for the app. It should match with the one you used when generating API keys.

Following up on this from a different angle:

There was a bug in later versions of the Google Maps framework that prevented maps from being able to be instantiated/created/added to superview if the app was in the background.

When you did that, the resulting map would show up as completely blank other than the Google logo in the bottom left. The reason for this is because OpenGL rendering is not allowable by the OS while backgrounded; they just needed to restart the renderer once it was foregrounded.

Google has finally fixed this (after about a year) so please upgrade to the latest and greatest.

If you use Google for Business:

pod 'Google-Maps-iOS-SDK-for-Business', '~> 1.11.1'

A repro of this issue is here for older versions.

Visual repro:

OpenGL Bug

Important: If you want to practice on google maps from iOS devices then just download the GoogleMaps.framework.

Unknowingly I have downloaded GoogleMapsM4B.framework and faced issues like 'your key may be invalid for your bundle id: com.company.example'

If you want to use GoogleMapsM4B.framework in your project then 1.You should request support on the Enterprise Support portal(Google's website) 2.You must enable Google Maps Mobile SDK for Work not Google Maps SDK for iOS in Google’s console website.

Incase if you want to use GoogleMaps.framework not GoogleMapsM4B(Maps for Business) then you need not request support center, you just need to enable Google Maps SDK for iOS in Google's console website.

You can find the key differences between the Google Maps SDK for iOS and the Google Maps Mobile SDK for Work(M4B).

and import GoogleMaps/GoogleMaps.h to your file and pass your api key to below method:

[GMSServices provideAPIKey:@“Your API Key“];

(or)

If you have valid license then download GoogleMapsM4B.framework and import GoogleMapsM4B/GoogleMaps.h to your file and pass api to same method [GMSServices provideAPIKey:@“Your API Key“] but I guess you may get this key only after purchasing license.

So the main issue I have faced is... instead of downloading GoogleMaps.framework I have downloaded GoogleMapsM4B.framework and added to my project. Every time I run my project it gave me an error saying "Your key may be invalid for your bundle ID: com.example.sampleapp"

Now my project is working properly.

Looks like you haven't specified a valid API key. Do you have one?

This error is indicative of an invalid key used to initialize the Google Maps:

[GMSServices provideAPIKey:@"YOUR_API_KEY"];

The key is issued by Google specifically for the iOS SDK (apparently only to a few chosen ones); the keys for Google Maps SDK v2 and v3 would not work on Apple.

A way to confirm that the error is indeed caused by an invalid key is via displaying a pushpin. Pushpin does not require a valid key, so it will be visible on an empty map view object. Coding the example from the Getting Started page https://developers.google.com/maps/documentation/ios/start#add_a_map should result in the app displaying an empty map view (with yellowish background and a pushpin at the center).

The best way to guarantee the pin is visible is to use exactly the same coordinates for both the camera and the marker, see the snippet:

GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:43.65
                                                        longitude:-79.45
                                                             zoom:6];

mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];

mapView_.myLocationEnabled = YES;
self.view = mapView_;

GMSMarkerOptions *markerOptions = [[GMSMarkerOptions alloc] init];
markerOptions.position = CLLocationCoordinate2DMake(43.65, -79.45);
markerOptions.title = @"Greater Toronto Area";

[mapView_ addMarkerWithOptions:markerOptions];

Another heads up! Ensure that your app's bundle identifier matches the bundle id defined in the "iOS apps" field in Google APIs Console.

Got the same issue. For sure did everything right. And the thing was that your API key needs some time to get working (maybe information about it propagates through google servers, meaning your closest server could not yet know about the new API key).

So in some 5 minutes after API key creation errors stopped and I have fully working API key. (note, I didn't receive any e-mails from google).

This helped me out: (Misspelt API key because XCode originally returned an error unless API was surrounded by {} IOS - ObjC Google Maps Api Key

I solved this problem as follows.

  1. Go To Google Maps API Console(Old). Enabled Service was Google Maps SDK for iOS and Google Street View Image API.
  2. I have disabled Google Street View Image API.
  3. And Then, error is no longer output.

for me it was due to that my app's bundle identifier has been changed. After taking new API key for the new bundle identifier it start to work again.

First thing is make your keys are right. Than check if you have enabled Google Maps SDK for iOS. Than run app on device, rather than a simulator.

try not to save API Key on any constants. Directly pass the value. If it is not working try regenerating the API Key Map will work for sure

MapServices.ProvideAPIKey ("AIzaSyAnxfhuAwEqdVhQpoUkGFZpsBukOSXVFr0");

happy coding :)

Now Apple remove the Google map and Add Apple map,.

Check the Following things:

  1. Decrease Zooming in Map View.

  2. What version iOS Used? if you used iOS 6 the google map not work Apple map must work.

  3. Some times the Simulator not support some core functionalists kindly check the functionality to device.

  4. Make sure the delegate and datasource must set.

Thanks.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top