Discussion Forums  >  Uncategorized

Replies: 8    Views: 1570

Kamal
buzztouch Evangelist
Profile
Posts: 17
Reg: Oct 28, 2010
India
170
01/19/11 11:04 PM (15 years ago)

Problem while using Google Maps in Android Project.

In order to setup Google Map API Keys in project. I have follow all 3 steps in Readme.txt file. & After performing all steps.I am getting an error while running the project. The Eclipse log are as follow: ----------------------------------------------------------------- Android Launch! adb is running normally. Performing com.v1_4.B3F436D351291B3F.com.Act_Home activity launch Automatic Target Mode: launching new emulator with compatible AVD 'my_avd' Launching a new emulator with Virtual Device 'my_avd' New emulator found: emulator-5554 Waiting for HOME ('android.process.acore') to be launched... HOME is up on device 'emulator-5554' Uploading Mobi.apk onto device 'emulator-5554' Installing Mobi.apk... Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY Please check logcat output for more details. Launch canceled! ----------------------------------------------------------------- Kindly suggest...
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/19/11 11:45 PM (15 years ago)
Sounds like you don't have the Google Maps External Library installed in your Eclipse setup. Common, happens all the time. Easy fix. See this: http://code.google.com/android/add-ons/google-apis/maps-overview.html Also, be sure to find the Screen_map.java file (may not be called that exaclty, can't remember, look in /src folder. This file is probably configured to look for your Google Maps DEBUG API key. You'll want to change this when you compile for Release. Change it in this file to use the Release Key when the time comes.
 
Kamal
buzztouch Evangelist
Profile
Posts: 17
Reg: Oct 28, 2010
India
170
like
01/20/11 02:27 AM (15 years ago)
David, I have used Google Maps External Library in my Eclipse setup Refer:[https://docs.google.com/document/d/10rp1jbPrwKn6uueT9u68r-lAYfj1hDS3d7EBzWIZLsw/edit?hl=en]. & the file for Map is Screen_LocationMap.java. Can you guide me which parameter/variable to change for debug/release api key in Screen_LocationMap.java.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/20/11 02:56 AM (15 years ago)
Good. This should mean that your app doens't show the INSTALL_FAILED_MISSING_SHARED_LIBRARY missing library anymore. The symptom now should be... On a device (testing on a device is soooo much easier than the emulators. Attach device with cord and choose from AVD manager if you are not already doing this) it runs and works fine. But, the maps are not showing up because you are in debug mode. Or, the map screen works but the map tiles don't show up, only the pin marking the location(s). This is where the debug / release cert comes in. a) find the /res/values/strings.xml file in the project. You'll see where to enter the two Google Maps API keys. One for release, one for debug. b) find the screen_locationmap.xml file in the /res/layout folder ( i was wrong eariler, the adjustment is not in the Screen_locationMap.java file, it's in the layout file. c) find the entry for @string/googleMapsAPIKeyDebug and change this to @string/googleMapsAPIKeyRelease when you're ready to compile for the real-world. Lots and lots of folks have done this with no trouble (literally many many thousands) so I'm sure you can too. It's a bit tedious with Android (iOS is much easier) but you'll get the hang of it soon. It really is efficient once you understand how all the Android SDK parts fit with the Eclipse IDE. Good luck.
 
Kamal
buzztouch Evangelist
Profile
Posts: 17
Reg: Oct 28, 2010
India
170
like
01/20/11 03:30 AM (15 years ago)
David, Apologies,I forgot to mention that Google Maps Library were already added in the project & the problem of INSTALL_FAILED_MISSING_SHARED_LIBRARY still persist. a)Done.. b)Done.. c)In the screen_locationmap.xml android:apiKey=@string/googleMapsAPIKeyDebug Should i enter the orignal debug key here(i.e android:apiKey=0cJ3IeBArZlIux4sMDxo1VKHRTUR0Aj6pvsftpQ ) while in debug Environment. You are right.I need to get deep view in the code & it will be easy to understand what is going on... I will also try to run project with Device.
 
Kamal
buzztouch Evangelist
Profile
Posts: 17
Reg: Oct 28, 2010
India
170
like
01/20/11 03:31 AM (15 years ago)
Thanks 4 such a quick response... :D
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/20/11 03:35 AM (15 years ago)
Yes, use Debug while you are testing. Done put the key itself in the layout.xml file, the key itself is stored in the strings.xml file. The layout.xml file points to the strings file. So.. your screen_locationmap.xml file will be @string/googleMapsAPIKeyDebug OR @string/googleMapsAPIKeyRelease The @ character means go to the strings file and get this value. This approach allows you to store important keys and data items in one place, outside of the source-code, easier to update. You could also see this: http://stackoverflow.com/questions/1113088/install-failed-missing-shared-library-error-in-android
 
Kamal
buzztouch Evangelist
Profile
Posts: 17
Reg: Oct 28, 2010
India
170
like
01/24/11 05:29 AM (15 years ago)
David, I have tried the key in screen_locationmap.xml, It looks like : android:apiKey=@String/0cJ8IeBArZlIux5sMDxo1VKHRTUR0Aj3pvfjtlQ It gives me error : No resources found that matches the given name. The solution provided in link didn't worked for me. Can you suggest where i am going wrong Thanks
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/24/11 11:43 AM (15 years ago)
the No Resources Found erorr is usually a typo. In looking at your snipppet above, it looks like @String has upper case S. It should be @string
 

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.