What's the google-play-services_lib jar's size? - android

I'm having the blank screen and zoom buttons issue and I think all permissions and my key codes are typed correctly, the project is registered at the Google's APIs Console site and Google Maps Android API v2 service is checked
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myProject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<permission android:name="com.myProject.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.myProject.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.myProject.ScreenMap"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="myKey"/>
</application>
</manifest>
So I was looking at that jar's path and it's size is only 1kb, so I'm curious if the jar is damaged since the google-play-services's jar's size is about 578kb

Just to clarify the 1kb JAR phenomenon :
The Google Play Services Library Project itself doesn't contain any (real) java code. It contains a single dummy UnusedStub.java, simply because the Android tooling / build system needs at least 1 java class otherwise it is considered an invalid project.
adt-bundle-windows-x86_64-20130514\sdk\extras\google\google_play_services\libproject\google-play-services_lib\src\android
This is in fact the 1kb JAR you are probably seeing.
The actual Google Play Services code is in the libs folder of the Google Play Services Library Project.
adt-bundle-windows-x86_64-20130514\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services
That is 578kb JAR containing the com.google.maps.gms package and classes (the actual Google Maps V2 code.
If you didn't mess around with the library project, and simply added it as a reference to your project, you should see 2 JAR files in your projects bin/dexedlibs folder
google-play-services_lib-85cb1c92715dbebbf9272cc8771ff1ee (1kb - the library project)
google-play-services-802bdd645fa52832629ef9a428b8df7e (the JAR file in the libs folder of the library project)
I assume you have correctly imported the library project, otherwise your project would not be able to resolve any classes imported from the com.google.maps.gms package.
You need to check the ADB logs to see what is going on while the map is being displayed. Most likely it's an authentication issue. Double check your API key and the API console and make you sure you entered everything correctly :

Related

Why are my android manifest not merging?

So I've an Android lib that I made, that library has an activity a service and some permissions declared in the lib manifest.
I also have a demo app which uses the lib jar. So what I want to do is to use that lib on that demo app or any other app without having to declare the activity, the service and if possible the permissions each time I use the lib.
If I don't declare the activity, the service and the permissions in the demo app my demo app crashes on runtime. As far as I know; Android merges the manifests but I don't thinks that its doing it.
Here is my lib manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mylib">
<!-- This app records A/V content from camera and stores it to disk -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application>
<activity android:theme="#style/Transparent"
android:name="org.mylib.activities.CheckStoragePermissionsActivity"/>
<service android:theme="#style/Transparent" android:name="org.mylib.services.BackgroundVideoRecorder"/>
</application>
</manifest>
and here is my demo app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mx.mydemo">
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.RegisterUserActivity" />
<activity android:name=".activity.LogGameDataActivity" />
<activity android:name=".activity.GameResultsActivity" />
<activity android:name=".activity.PasswordResetActivity" />
</application>
</manifest>
Is there something wrong in any of my manifest that is not allowing them to be merged? Does the lib manifest package and the demo app manifest package needs to be the same package?
Greetings
By the way the lib and the demo app are 2 different and separate projects I'am pasting the lib jar in the demo lib folder and then I'm telling android studio to import the jar as a library.
That is not going to work. The JAR is just Java code; it does not contain the manifest, resources, or assets from the library module.
Either:
Move these into one project as separate modules, then use compile project() syntax in the demo project to pull in the library module, or
Publish the library module as an AAR to an artifact repository (a local one on your development machine, Maven Central, JCenter, whatever), and have the demo app pull it in from there, or
Copy the AAR, not the JAR, from the library project into the demo project
I strongly recommend either of the first two options.

Google play Key in manifest made a lot of errors and red exclamation mark

So i followed this guide https://developers.google.com/maps/documentation/android-api/signup
and created a new Google Developer Console project in here
https://console.developers.google.com/home
I put my Eclipse project package name and got the Google Key.
Now as the guide said i added this to my manifest
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
and after i did that i have got a lot of errors in my project and there's also an red exclamation mark near all of my projects of this workspace.
So what I'm doing wrong? I just want to start develop using google play. And please, i read all the guides in their and eclipse's and i still can't get it to go.
EDIT
I think i might missed the google play services library. I cant find where to download it.
manifest: as requested.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.minyan.get.dl"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission
android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MyLocation"
android:label="#string/title_activity_my_location" >
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCzVDpAckc5p3DGRIJsco-CyIiFfjgn--k />
</application>
</manifest>
Like in the guides the <meta data /> is in the application tag.
To make the Google Play services APIs available to your app:
Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects.
Import the library project into your Eclipse workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the <application> element:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Basically google play services library is not needed to download, it resides in your SDK only
and here is the path, you can find the library
.../sdk/extras/google/google_play_services/libproject/google-play-services_lib
I think the following could solve your problem:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCzVDpAckc5p3DGRIJsco-CyIiFfjgn--k" />
^
!

Google Maps Android API fails to load map

I know there are many questions like this, but I've verified that everything is set up correctly. The worst part is that it worked perfectly fine until I reinstalled Windows. (I did update it with the newly generated debug key).
Debug keystore
Google API console
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nl.whileio.ovaub" android:versionCode="1" android:versionName="1.0">
<!-- Android 4.0+, almost entire target market nowadays and native action bar is convenient -->
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="19" />
<!-- Internet and GPS -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Google Maps requires these -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- OpenGL ES 2.0 required to render maps -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application android:allowBackup="true" android:icon="#drawable/ic_launcher" android:logo="#drawable/ic_logo" android:label="#string/app_name" android:theme="#style/AppTheme">
<!-- Google Play services -->
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<!-- Google Maps API key -->
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyD1xkO8zpfyWP52qqt6cuxnWPU5eOfxZVM" />
<!-- Main side bar + fragments activity -->
<activity android:name="nl.whileio.ovaub.view.MainActivity" android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Logcat
This appears right away:
And this appears about 20 seconds after the app has started:
That almost makes it look like there are actual network problems. The Google Maps application and other apps load maps fine, however.
What I have tried:
Regenerate API key in API console a few times
Uninstall and reinstall app after every single change
Ran Project -> Clean -> Clean all projects a couple of dozen times
Tried the maps API sample with appropriate key and package, made no difference
Tried signing with a real keystore, also made no difference
Verified with keytool that the installed APK (cert.rsa) really does use the correct debug keystore, which it does
Restarted my phone
Any ideas what I can do at this point?
I created a completely new project in the Google API console, which seems to have solved the problem.
i suggest you came to visit here to download a sample code of hello map Android from Google it self, then you can follow the tutorial in there, i have a same problem with you, but when i find this the link i gave you, now it's working.. i hope it can help you
Please Read Carefully the tutorial, i'm sure it's working :D

Google Maps Android V2 - Blank Screen

I am implementing google maps for android. I created a test application and inserted all the permissions etc in that application and the application worked flawlessly.
But when I try and copy the same code to my real application it shows me blank screen on the android activity.Although I've updated the package name in the google api console.
Here's what my Test Project Manifest Looks Like :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapstutorial"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.example.mapstutorial.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapstutorial.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my api key"/>
<activity
android:name="com.example.mapstutorial.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and here's what my real project manifest looks like :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shop.shoppinglist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<permission android:name="com.shop.shoppinglist.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.shop.addtask.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.shop.shoppinglist.permission.C2D_MESSAGE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:allowBackup="true"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
<activity
android:name=".Login_Activity"
android:label="#string/title_activity_main"
android:theme="#style/Theme.Sherlock"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I updated the package name to com.shop.addtask in my console fingerprint but still it shows me the white screen.What could cause the problem ? The apikey I've used is same in both of the applications. But it works on test application not on the real app.
I've created the api key using the fingerprint
I've switched on google maps android v2 in the console
I am using the same api key as mentioned in the console.
So these things are correct and the problem cannot be caused by one of them.
2 possible reasons:
1. this part:
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
should right before the closing application tag.
2. Most likely you have some sort of problem with your key. Try to generate a new by deleting the debug.keystore folder and running a project. then register it again via the console.
you can use this guide I wrote to do just that:
Google Map API V2 key
Update:
Check this for a second:
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
it looks that the package you set here is not the package of your application and should be:
<uses-permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE"/>
<permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<permission android:name="com.shop.addtask.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.shop.addtask.permission.MAPS_RECEIVE"/>
package name is
package="com.shop.shoppinglist"
Hope below link helps you, AndroidManifest.xml for Google Maps Android API v2
try this,
<permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.shop.shoppinglist.permission.MAPS_RECEIVE"/>
After everything fails, try to uninstall the app and try it again. It worked in my case.
My problem was that I've changed the app's package name in the AndroidManifest file, but not the gradle.build's "applicationId" property, maybe that helps someone...
I had the same problem. I tried everything suggested on the different solutions on this error. Inclusively, I recreated my API key(including creating a new project) and nothing worked. After many, many hours wasted, I decided to delete all myapp user data on my android device, and magically this took care of the problem. My maps display correctly! Yay!!!
Android 4.2.2: Settings/Apps/YourApp/Clear data.
I hope this simple solution helps when everything else fails.
ok, I have the same problem, I follow all the steps in the blogs and the google official page and not working, the solution is correct
<uses-library android:name="com.google.android.maps"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my api key"/>
before close the application tag, but in the other case I found the solution, the problem is I generate SHA1 code in a macinthosh but I clone the repository and work in windows plataform but I found this problem, my solutions is that go to google console and generate other apikey but get the SHA1 code using this comand in windows,open the console
and typed this code
cd C:\Program Files\Java\jre1.8.0_20\bin and press enter
next step copy and paste this code
keytool -list -v -keystore %HOMEPATH%\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
after press enter inside the console you show the SHA1 code copy and paste in a google console,is very important specified SHA1 code ";" and correct package ..
regards!!!
I 've got a similar problem with the map. After fixing all lib and key problems, I just saw a white sreen labled with "Google".
The problem was, that I put the MapFragment into a ScrollView. After removing the ScrollView everything works fine. I can see the map.
Check whether you enabled Google Maps Android API or not
Open Google Map developer console.
Go to Library -> Google Maps Android APIs
If it is disabled, enable it.

Google MapFragment is blank (white) with Could not find class 'maps.j.k'

I'm trying to build the official android google map api v2 sample on a (gingerbread 2.3.5) phone .
I added android-support-v4.jar to official sample project.
I took the sample from the official tutorial in <android-sdk>/extras/google-play-services/samples/maps
I copied the sample app in Eclipse, reference the google-play-services_lib project as an Android library, and build the whole thing with the Android SDK 4.1.2 (api 16).
Unfortunately, ahen I launch the app the map is blank and I don't have any exception or message.
The only thing I got are those suspicious lines in the logcat :
Unable to resolve superclass of Lmaps/a/du; (411)
Link of class 'Lmaps/a/du;' failed
Unable to resolve superclass of Lmaps/a/ej; (2363)
Link of class 'Lmaps/a/ej;' failed
Unable to resolve superclass of Lmaps/j/k; (2379)
Link of class 'Lmaps/j/k;' failed
ERR Could not find class 'maps.j.k', referenced from method maps.y.ae.a
VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
I suspect that my project structure in eclipse 3.8 is somewhat messed up.
I tried the following things (even the most idiotic) to no avail.
1. Invalid api key ?
I generated a "debug.keystore" with keytool and updated the eclipse preference (Android/Build/Keystore).
Of course, I registered that new keystore/SHA1 and get a new api key that I used in the AndroidManifest file
2. Wrong project target ?
I tried to build my two projects with the following targets :
Android 4.2.1
Google Api 4.2.1
3. adding google-play-services_lib as a project dependency
I tried to add google-play-services_lib as a project dependency on top of being added as an android library in the demo build path.
And tick the matching export checkbox.
4. test google maps api v2 on the phone
I downloaded trulia real estate app that is said to use the v2 api on the phone to be sure that the phone is compatible with the new api
Here is the manifest for the sample app
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapdemo"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
<!-- Copied from Google Maps Library/AndroidManifest.xml. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- End of copy. -->
<application
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/demo_title" >
<!-- You must insert your own Google Maps for Android API v2 key in here. -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXXXXXXX" />
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".BasicMapActivity"
android:label="#string/basic_map" />
<activity
android:name=".CameraDemoActivity"
android:label="#string/camera_demo" />
<activity
android:name=".EventsDemoActivity"
android:label="#string/events_demo" />
<activity
android:name=".GroundOverlayDemoActivity"
android:label="#string/groundoverlay_demo" />
<activity
android:name=".LayersDemoActivity"
android:label="#string/layers_demo" />
<activity
android:name=".LocationSourceDemoActivity"
android:label="#string/locationsource_demo" />
<activity
android:name=".MarkerDemoActivity"
android:label="#string/marker_demo" />
<activity
android:name=".OptionsDemoActivity"
android:label="#string/options_demo" />
<activity
android:name=".PolygonDemoActivity"
android:label="#string/polygon_demo" />
<activity
android:name=".PolylineDemoActivity"
android:label="#string/polyline_demo" />
<activity
android:name=".ProgrammaticDemoActivity"
android:label="#string/programmatic_demo" />
<activity
android:name=".TileOverlayDemoActivity"
android:label="#string/tile_overlay_demo" />
<activity
android:name=".UiSettingsDemoActivity"
android:label="#string/uisettings_demo" />
<activity
android:name=".RawMapViewDemoActivity"
android:label="#string/raw_mapview_demo" />
<activity
android:name=".RetainMapActivity"
android:label="#string/retain_map" />
<activity
android:name=".MultiMapDemoActivity"
android:label="#string/multi_map_demo" />
</application>
</manifest>
Here are some screenshots of my project structure/build path.
I think maybe you make something wrong when you apply the api KEY.
I have the same problem, and at last I found that I turn on the incorrect service. at https://code.google.com/apis/console/,
There are Google Maps API v2 and Google Maps Android API v2.
You should use Google Maps Android API v2.
I had exactly the same problem (all configurations the same, maps.j.k stuff in the logcat). However, for me choosing Google APIs as build target solved it. But that was Google APIs 4.2, so I suggest that you install the update and try with the more recent target.
I resolved this issue by changing de targetSdkVersion with de last targetSdkVersion avaiable, at the AndroiMainfest.xml file.
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
Are you using ProGuard? Usually class names like "a", "b", etc. are a result of ProGuard obfuscating class names, and maybe the Maps API breaks when that happens. If that's the case, you will either have to disable ProGuard or add some -keep lines to your proguard.cfg file. This post shows what those lines might look like.
In my case it was due to 2 issues
on my phone the latest Google Maps app was not installed (in fact there was no google maps at all)
I didnt have all the required permissions set in my manifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
As documented in https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api
http://developer.android.com/sdk/index.html --this is the link for the adt bundle in android..try downloading this and start over again..maybe there's a problem with your ADT.
Check the console API you've enabled Google Maps Android API v2
I was dealing with same issue. I tried to implement the com.example.mapdemo and had a heck of a time.
I copied the code of the BasicMapActivity to a clean new project and made the Libraries look as above.
Basically, I couldn't get either to work. I got the "Authorization failure" error in the debugger.
Then, today, I prepared new keys specifically for each project with the specific com.example.xxx after the semicolon when preparing the key in the Google Console.
I did Project->Clean at every step.
I ran it in debugger first, then just Run. And, if I remember, a few times after making the change to the manifest.
Then, finally, they worked. It seemed, in the end, to require a key for each specific project.
Here's what worked for me. When you use the Google APIs Console to create your API key, be sure to append ;com.example.mapdemo to the SHA1 fingerprint. (I was using something else more appropriate for another app I'm currently developing.) What clued me in on this solution was an authorization error in the LogCat.
In my case I added LocationSource Interface so I can get location data but i forgot to add :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
at Manifest file.
Don't forget to use separate keys for debug and release version of the app!
If you have already tried everything, try to uninstall and reinstall again your app: on my phone (S3 mini), after the first launch with the wrong key, I corrected it, but it didn't work until a complete uninstallation.
Maybe some sort of caching is used.

Categories

Resources