Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 36

snits
Aspiring developer
Profile
Posts: 5
Reg: Aug 21, 2013
Sneek, Nederlan...
4,950
06/26/14 06:46 AM (10 years ago)

Cannot get location map in android

Hello all, i've been trying to create an app with help of the location map. The iOS part has been finished and is applied to the app store and is being used. I would also like to add this to the play store but i cannot get the location map plugin working. I tried most (probably all) of the manuals. Restarted several times, but it still doesn't work. I start off by downloading the zip file from BT in iOS and trying it in xcode. the map works flawless. When i than compile android i add locate gps in the settings and download it. I than import it in eclipse and add the google library. No errors appear and i can test the app in the emulator and it works, but no location map. I than export the package and create a keystore for release. with the SHA-1 fingerprint i add to the project in google developer console. i add a ; and the name of the project as it is stated in the manifest preceded by com. the key is created and i add it to the manifest xml and paste it within the quotations. I than export the project again using the same keystore. i install it on an actual device and all but locations work. the error i am getting is 'Google maps not available, there was a problem creating a google map. In most cases this error occurs because the android project was configured properly to run google maps. as stated i've tried different options and started over following several videos or pdf's. i learned a lot already, but would like to get it up and working. your help is very much appreciated. Greetings Chris from Holland.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/26/14 07:02 AM (10 years ago)
You may also want to remember, the 'key' needs to match the 'mode'... So if you're not using a debug key, which means you 'are' using a 'release' key, then change 'debug' to false in the AndroidManifest.xml file... just search for 'debug' and change the setting. You seem to know that maps do not work in the emulator, so checking on your device is the right thing to do. Just a few more edits and you should be golden. Hope this helps. Cheers! -- Smug
 
snits
Aspiring developer
Profile
Posts: 5
Reg: Aug 21, 2013
Sneek, Nederlan...
4,950
like
06/26/14 07:13 AM (10 years ago)
Hi Smug, thanks for your quick reply, really appreciate it. I tried it, but when i change it to false i get an error; Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one AndroidManifest.xml /sehandroid line 60 Android Lint Problem i have had this before and left it out. it solved the problem. but the maps did not work.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/26/14 07:23 AM (10 years ago)
Hmmm... well, it needs to be 'false' if you're using a release key. And all that SHA stuff has to be exactly right otherwise it won't work. In BTv2, it was a bit more hassle to get maps to work (although googles old API worked in the emulator), with BTv3 it should be a bit simpler, but everything is syntax when you come down to it. Check your work against a tutorial I wrote on the Google API Key, and ensure you've covered the steps... http://www.buzztouch.com/files/howtos/googleapiv2.pdf Note on the last page, in the screenshot of the eclipse environment, it shows an AndroidManifest.xml, on line 56 of that screenshot, it states: android:debuggable="true" and for a release key, it must be android:debuggable="false" in order to work properly. Also, in order for the SHA key to be 'exactly right' you need to be certain that your 'com.app.name' is 'truly' the app name. Make sure the app name you're using in your API Key matches line 4 of your Android Manifest; package="com.app.name" Good luck, and let us know how things turn out! Cheers! -- Smug
 
snits
Aspiring developer
Profile
Posts: 5
Reg: Aug 21, 2013
Sneek, Nederlan...
4,950
like
06/26/14 07:26 AM (10 years ago)
Finally managed it after some trial and error. I am glad that a macbook is expensive, if it was a cheap thing it would have flown through the window... what i think i did wrong is that i created 2 projects in the google developer console. both projects had an api that ended with com.myappname Probably this was confusing for google. After deleting one project on the developer dashboard and checking the keys of the correct project and updating them in the app, it finally got to work. thanks a lot for your help and getting me back on track. in the manual in a screenshot of the developer dashboard you have both google maps api v2 and v3. i couldn't find these and replaced them with google maps api v2. thanks again!
 

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.