0
votes

i have 2 days trying to make native google maps to work. I followed all the instructions i found, nothing. I searched for 2 days if others had any problems, i followed their solution but still nothing.

Maps appear on the simulator but not at the telephone. I tried with a dialog nothing. I tried to a container to the main form nothing.

I also tried final MapContainer cnt=new MapContainer(new GoogleMapsProvider("my_api_key")); but still nothing. With this i couldn't see the maps neither to the simulator.

I have downloaded from git first and then from the extensions but still the same. Nothing shows up.

Google api console shows the requests every time i try to see the map, but no map on mobile. I also used with SHA1 and without. The same results.

I noticed that in BuildHints it automatically adds android.playService.maps=true, and when i tried to add the android.includeGPlayServices=true there is a build error, cannot be used together the error log says.

My codanameone plugin version is 3.5.8

Thanks in advance.

2
E/b: Authentication failed on the server. E/Google Maps Android API: Authorization failure. Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: The api key exists. But how i can check that api v2 is enabled? - Kronos
For some reason I missed this question, sorry. - Shai Almog

2 Answers

0
votes

You need to have a google API key using this build hint:

android.xapplication=<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_ANDROID_API_KEY"/>
ios.afterFinishLaunching=[GMSServices provideAPIKey:@"YOUR_IOS_API_KEY"];

You need to login to the google cloud API console and turn on map support for your application picking "native Android" and then "native iOS" then copy the key for each and replacing the strings YOUR_ANDROID_API_KEY and YOUR_IOS_API_KEY respectively.

0
votes

Go to the Google developers console to check your credentials. https://console.developers.google.com/apis/credentials

Be aware that you need to remove the key restriction to make the API key work with Codename One.

enter image description here