Google Maps not displaying when using the sample - android

I have loaded up the SimpleMapDemo from the Google Play Services sample. I have retrieved a Google API Key, yet the map does not display when deploying the app to the emulator. There is no internal errors yet the map is not displaying.
I have generated a logcat output file to try and find the problem, yet I am not sure what to exactly look for.
May I please have some help to figure out what is wrong? Here is the logcat output file: http://canninginc.co.nz/logcat/logfile.txt
Thanks in advance.

Remember that you need a debug key certificate to get your api key, i mean, you dont have to use your real key certificate.
make sure your JRE folder is in your PATH
open CMS and go to C:\Users[USER NAME].android
run keytool -list -v -keystore debug.keystore -storepass android -keypass android
copy the Certificate fingerprint SHA1
go to https://code.google.com/apis/console/ and create your api key with this fingerprint
Also, check out the version of your emulator. Remember that Play services only work on SDK version 4.2.2 or higher.
http://developer.android.com/google/play-services/setup.html
Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services.
also, there are some tricks around to make it work in previous versions, i guess you already tried since google gives a lot of useful results

create your new google maps API Key and replace this key in AndroidManifest

Related

Game services not working for app if downloaded from play store

I've been trying to get the game services working properly for so long. My problem is that game service isn't working on the version downloaded from the play store, but on the version downloaded directly from android studio the game service works perfectly. Even though both versions use the same key and have the same SHA1 code (the release SHA1 code). I checked if the SHA1 from the play store version of my app matches with the game service's SHA1 by comparing the SHA1 codes from the android-release.apk and from https://console.developers.google.com/apis/credentials/oauthclient. I doubt that the problem lies in the code of my app, because it works perfectly in the version downloaded directly from android studio.
So my question is what I could have possibly done wrong here, and how to fix it.
Thank you for reading
First off, I want to thank everyone who took their time to post an answer. I don't think anyone could have guessed my stupid mistake because it only applies to libGDX users. The problem was that the target sdk in the gradle .build file of BaseGameUtils was not the same as the .build file of the android module. It's amazing how such a small mistake can cost your whole weekend!
I had the same problem:
You need to use this:
keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v
example:
keytool -exportcert -keystore D:\Hristijan\Aplikacii\Keystore\blabla.jks -list -v
This is the PATH where you created the keystore while building the APK FILE.
The problem was that we were using the SHA1 key for debug in OAuth 2.0 client IDs, and as i understood SHA1 for debug and release is different.
So after you get the SHA1 for the release, you go to google cloud platform and in Credentials change your SHA1 for your app.
When using Google Play Services SDK, check and make sure that your device is also compatible and runs Android version 4.0 or higher and includes Google Play Store.
See this documentation for more information. And, this article wherein it discussed about matching Google Play Services to your Android OS version might also help

google map not show in release apk using android studio

I am developing an app, here I'm using google map in debug mode map shows correctly but in release mode map not showing and shows only current location.
By using google map API I have tried but still its not working and also I find the SHA1 by using keystore(i.e. keytool -list -v -keystore file path.jks) then also its not working.
By using following views I tried and found the SHA1 key but map not shown in app.
Release APK file not showing google maps
How do i do?
Have you set your google_maps_key in both debug & release folder in google_maps_api.xml.
If not please, set it. You can find both folders inside Project structure.
See image for reference.
Generate API key access using release key-store. And set Google API console.
Go to google API console.
crate new project
generage API key
enable your service
add API key in your project
OR
You can simply follow this developer guide LINK.
If you have troubling in getting SHA-1 key. You can easily get it by running Signing-report gradle task as below picture (in Android studio).
I solved it by looking at Google Play Console in the left menu select configuration, then integrity of the app and then copy the sha1 of the upload key certificate that is below of the SHA1 Certificate of the app signing key and add it in the same API key of Google Cloud Platform. This way I didn't have to make changes to the apk.
If it doesn't work for you, add both and try.

Google Play Services v7.8 Nearby API AUTH_API_ACCESS_FORBIDDEN

Has anyone gotten the Google Play Services v7.8 Nearby API to work? I’m getting the status error below when I try to subscribe for messages. I've enabled the API and configured the key, etc. in the Developer Console as described here.
Status{statusCode=AUTH_API_ACCESS_FORBIDDEN, resolution=null}
I tried the newest NearBy API demo and succeed.
You can just go here and clone it. Open it in Android Studio, and follow the following steps:
Create a project on Google Developer Console. Or, use an existing
project.
Click on APIs & auth -> APIs, and enable Nearby Messages API.
Click on Credentials, then click on Create new key, and pick Android
key. Then register your Android app's SHA1 certificate fingerprint
and package name for your app. Use
com.google.android.gms.nearby.messages.samples.nearbydevices for the
package name.
You can get SHA1 by using: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v and the password by default is android.
Copy the API key generated, and paste it in AndroidManifest.xml.
Not sure whether to make it as an answer.
But I scratched my head for 5 hours and figure out the issue.
I've more than 5 projects on my google API console.
Everything was perfect for the sample project.
But with actual project, I forgot to enable API :(

Android Google Maps API V2 not showing map when published

Just ran into a problem, when testing on device while in development - maps worked fine.
After I published it to beta stage I downloaded it from Google Play Store and ran the app, but map showed up grey and didn't work.
What am I doing wrong?
my api key is specified in manifest like:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY_HERE" />
Okay, got it fixed.
When I exported and signed the apk for publishing it gave me SHA1 and MD5 keys.
I just copied SHA1 key and went to Google API's and edited allowed Android Devices.
There I added new line so the new Android Devices looked like:
debug.key.sha1;package.app
just.generated.sha1;package.app
didn't even need to reupload new APK, it just worked straight away.
Also this helped:
http://smdaudhilbe.wordpress.com/tag/google-maps-v2-not-displaying-after-app-published-in-google-play/
The key is bound to the apk signing - I am pretty sure this is your problem there
When you publish an app that uses Google Maps API and your map in the released version is blank or gray then do the following...
find your keystore (*.jks file) (you needed to generate this in order to publish anyway)
execute something like this in command prompt (Windows)
"C:\Program Files\Java... whatever java version you have ...\jre\bin\keytool.exe" -list -v -keystore
myappkeystore.jks
You'll see a bunch of info including your release APK's SHA1 if done right.
Go here:
https://code.google.com/apis/console
Opt out of the new interface (its horrible) and use the old interface if possible
In old interface go to services and make sure Google Maps is enabled
Now go to API Access and update your old SHA1 with the new one by click "Edit Allowed Android Apps" to the right and overwrite the old one with the new one. Click Update. Done.
When we deploy on Play Store, Google generates a new SHA1 hash for the version published. To solve this issue, it is necessary to open the application's console on the Play Store and take the new SHA1 in Version Management -> App Subscription. Finally, you can use this SHA1 in Google Maps API Console to generate your Maps key.

android map v2 won't show in debug mode

do i have to publish the apk everytime in order for the map to show? My map won't display while running via eclipse, i have to export to apk and then install on my deivce to test. Is there a easier way to test a map v2 apk? Thank you!
First thing you have to Use your debug.keystore file from .android folder and then generate SHA1 using that keystore.... in Command Propmt.
And then you have to generate your Google Map v2 API key using this SHA-1 from Google API Console.
And use this key in your application and you don't need to Export your Signed application..
Thanks..!!
You can't display maps in the Emulator since it doesn't have Maps installed in it. You must run all the Maps related applications in your android device.
Also, Just connect your device to the PC/laptop and eclipse will automatically prompt in which device you want to run and then you can select your device.
Its because there is no maps in your emulator. Your map will display only on a pure AVD, i.e. it CPU of emulator must be ARM, and the target should be a Google APIs device. For Maps V2, you need google play services installed in your emulator/device. By default its not available in any emulators.
You can force install google play services into an emulator, follow this for a start.
The better option is to use a device(mobile/tab) via USB with developer options enabled (USB Debugging checked).
Try it...
Use this command to generate SHA1 certificate with your debug.keystore, than generate API key with generated SHA1 certificate
How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
After generating key from API console use that key to your Manifest file.
There is, but you need to modify your debug key in eclipse (I'm assuming you are using eclipse).
First off, The google mapview stuff only shows when the Api key you are using is derived from the signing key. Here lies the problem - eclipse uses its own default key when you're launching from the IDE.
So you need to use your actual signing key for the debug. If you go to Window -> Preferences -> Android -> Build, you will see that eclipse is using a default debug keystore.
You have there the option to use a custom debug keystore. BUT NO WAY TO SET CUSTOM PASSWORD.
Good thing you can change the password on your original signing key (I prefer to create a copy and tag that as my "debug" key) and still retain all/most of its properties, I honestly don't know which ones, such that you can now use it as a debug keystore and still have it display the google maps layout.
To change keystore password just fire up cmd and do:
keytool -storepasswd -keystore my.keystore
Eclipse uses "android" as the default password for debugging, that's what you enter as new password.
After modifying your key, you can now set it as the custom debug keystore and start going Ctrl+F11 on your android source.
As far as I know, you can even override installation of the normally-signed app on your phone with this technique, so it goes further than just having google maps enabled while debugging.
C:\Program Files\Java\jdk1.7.0_03\bin> keytool.exe -V -list -alias androiddebugk
ey -keystore "C:\Users\Dell.android\debug.keystore" -storepass android -keypass android
type this in CMD.this will give both sha-1 and md5 key..plz change path as per ur machine..!
Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

Categories

Resources