Discussion Forums  >  Maps, Device Location, Tracking

Replies: 7    Views: 177

Lex
Aspiring developer
Profile
Posts: 29
Reg: Dec 25, 2013
Ecuador
2,840
01/19/14 05:54 PM (10 years ago)

Can't use Location Plugin

Hi, i'm new member here and need your help... I almost have my first app, but i have one google map, i followed all instructions like create an api key from google, put that api in my manifest file, like here; android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxx"/> Also here: <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxxx"/> The Google Play Service Lib are referred to my project.. but when i launch the map in my app i see this error: "There was a problm creating a Google Map. In most cases this error occurs beacuse the Android Projject was configured properly to run Google Maps" What am doing wrong here? something is missing? i need put maps for stores, maybe some alternative? Thanks in advance to all!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/19/14 06:21 PM (10 years ago)
Hello, When you sign your app, you need to use the same keystore to sign it that you used to get your Google Maps API v2 key. Did you do that here? Also...if you're trying to view maps on the Emulator, it doesn't work at all, unfortunately. You can only see maps using a real device. Hope this helps a bit! Getting maps to work can be tricky for some reason. Let us know if you continue to have problems, and we'll work through them! Mark
 
Lex
Aspiring developer
Profile
Posts: 29
Reg: Dec 25, 2013
Ecuador
2,840
like
01/19/14 06:26 PM (10 years ago)
hi and thanks for your quickly answer... about your asnwers: "When you sign your app, you need to use the same keystore to sign it that you used to get your Google Maps API v2 key. Did you do that here?" Yeah.. i followed your tutorial for key tool and create one keystore, then i signed with the same... (well i'm still a little confused with debug and release keys but i followed step by step your tutorials, i thing it's ok) "Also...if you're trying to view maps on the Emulator, it doesn't work at all, unfortunately. You can only see maps using a real device. " Yeah i now, i'm testing the app in my real device, i have my app almost finished!!! just need the maps... Also in my manifest file i change debbug from true to false... Thank you again for your answer...
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/19/14 08:53 PM (10 years ago)
Hello, As long as you're signing it with the same keystore you generated your SHA5 certificate with, then you're OK. The debug keystore comes by default with your Android SDK installation. If you watch some of my videos (like going from the control panel to the emulator), you'll see an example of it in use. If you are testing with a real device, the LogCat output during the time the map won't load can be super helpful. If you can paste that output here (the part that occurs when the error happens...not the entire file) or send it to me at MrkFleming at gmail dot com, I can take a look at it. As for the manifest file, it's OK to leave debug set at True. In fact, you'll need it set to True in order to see the LogCat output. If you have the apk, you can also send that to me, and I can run it on my device and check things out. Mark
 
Lex
Aspiring developer
Profile
Posts: 29
Reg: Dec 25, 2013
Ecuador
2,840
like
01/20/14 08:36 AM (10 years ago)
Hi Mark, thanks again for your help, i already sent you an email with my apk file. About the LogCat i'm installing and testing in my device but is not connected to my eclipse because it showing me and "Target Unknown" error, so, i could not fix that and for that reason i better just creat apk, and then upload to my phone and test it. About keystore is the same, i check again and is correct... I'm waiting your answers.. thanks for your help!
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
01/21/14 06:10 AM (10 years ago)
Hi I was having the same problem and been struggling with this issue for the last few days. I have finally just got it working and never been so happy to see a map in my life. I am not experienced in coding so some of the steps may be unnecessary but I if it works that's all that matters :-) 1) I created 2 new keytool certificates one called xyz_debug & xyz_release (use any name you want). I then opened the Keytool window and imported xyz_debug, xyz_release and androiddebugkey into the keytool. 2) Then in Google API Access I chose to delete the API key I had and create a new one (but don't think this is necessary I just wanted to start fresh) then I pasted the SHA1 fingerprint for each of the 3 keys with a ;com.myandroidpackagename behind each one this is just a short example below: 1X:2Y:12:B5:XX:XX;com.abcpackagename (this one for xyz_debug) 2Y:2Z:34:A6:XX:XX;com.abcpackagename (this one for xyz_release) 3Z:1A:12:B3:XX:XX;come.abcpackagename (this one for the Androiddebug key) Before I added the 3 certificates and included them in the Keytool logcat kept saying to me Google couldn't find the API key but afterwards it gave me a different message (see point3 below). 3) Then in package Android Manifest I added the API key from Google and a 2nd line of code (meta-metadata...) because when I ran the app the log cat it said it could see the API key but it needed this code so I added it. <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="XYZ123MYAPI KEY"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> So now I got rid of the error message YAY but got a blank white screen in its place not so great. Then I read this note on StackOverflow today which was the final key to the puzzle. 4) Open your android tablet or phone and click on SETTINGS-APPS-YOURAPP and you'll see in the middle a box with CLEAR DATA Click it and OK. Try running your app now and if that doesn't work then Clear the data again, uninstall it and upload another APK file onto your tablet/phone and install it and hopefully it should run now. If it still doesn't work then one of the experts will have to weigh in and help you. Regards Sherry
 
Lex
Aspiring developer
Profile
Posts: 29
Reg: Dec 25, 2013
Ecuador
2,840
like
01/21/14 06:51 AM (10 years ago)
Sherry and Mark thanks both of you.. Finally I got it! Sherry like .. I was never so happy to see a map! ... the solution is to add the line that show in logcat: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> Again, thank you!
 
Sherry
Lost but trying
Profile
Posts: 135
Reg: Jan 05, 2013
South Africa
11,650
like
01/21/14 06:57 AM (10 years ago)
GREAT glad to hear that. :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.