Reputation: 866
I did al procedure to add google maps api but i am getting this errors. Sorry for bad language.
09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/a/du; (406)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/a/du;' failed
01-09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/a/ej; (2358)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/a/ej;' failed
01-09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/j/k; (2374)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/j/k;' failed
01-09 12:20:55.359: E/dalvikvm(5918): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
01-09 12:20:55.359: W/dalvikvm(5918): VFY: unable to resolve new-instance 3566 (Lmaps/j/k;) in Lmaps/y/ae;
Here its the manifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.comparto.piso.permission.MAPS_RECEIVE" />
<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" />
<permission
android:name="com.comparto.piso.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<application
........ >
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="api key" />
......
.....
In java code i extends FragmentActivity and here its the onCreate code
GooglePlayServicesUtil
.isGooglePlayServicesAvailable(getApplicationContext());
GoogleMap map = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
if (map != null) {
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
here its the layout xml
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="300px"
class="com.google.android.gms.maps.SupportMapFragment" />
Upvotes: 5
Views: 13056
Reputation: 45052
I had same white screen issue after a little resaerch I find out I had forgot to enable map APi from developer console as shown in pic below :-
I hope you might have same problem and it will help :-
Upvotes: 2
Reputation: 34360
you have missing api key
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="api key" />
enter api_key in value parameter
And google playService
version is also missing . Add
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
to manifest
inside <application
tag
Upvotes: 0
Reputation: 1241
Maybe your SHA1 key of your eclipse was changed (EX: You maybe deleted .android folder in home folder of windows) so it is the reason why it authentication error. You must delete your key and create new key with new SHA1 of eclipse.
Regen new key in here and reload this page in some minutes, it will update new key: https://console.developers.google.com/project/watchful-net-796/apiui/credential
Remember! After all, you must copy new key to manifest and rebuild your project. Good luck!
Upvotes: 0
Reputation: 14059
All the "Unable to resolve superclass xxxx" and "Link of class xxxx failed" from Dalvik in the logcat is normal if your device is not on the same API level as the one used by the Google Maps library.
You should check whether you are getting an authorization failure instead by using this command:
adb logcat | grep Maps
If you see something like this:
E/Google Maps Android API(): Authorization failure.
Then it would mean that you are not supplying the correct API key in your manifest. Check again in your Google API Console (in the API Access section) whether you have added the correct fingerprint and package name pair as described in the guide.
Upvotes: 5
Reputation: 766
If you use "class="com.google.android.gms.maps.SupportMapFragment" in your layout xml, you are now using your android:minSdkVersion under Android 3.0 or lower in your manifest.xml.
And then see my linked site below, which is helpful for you to understand what you should install and set before running the Google maps on your device. This link is very easy and you will get what you want to do in order to display google maps on your device.
My linked site ===> just Click here
Upvotes: 0
Reputation: 31996
That error message usally occurs when running on a device that does not have Google Play APIs available. You call isGooglePlayServicesAvailable()
, but you are not checking the return value. You should check to make sure it returns ConnectionResult.SUCCESS
before proceeding. In the case of some other error codes, you can have them prompted to upgrade/install via getErrorDialog()
, like --
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
switch (resultCode) {
case ConnectionResult.SUCCESS: // proceed
break;
case ConnectionResult.SERVICE_MISSING:
case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
case ConnectionResult.SERVICE_DISABLED:
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1);
dialog.show();
}
According to Google, Google Play services API's require 'physical development device', so they are not officially supported on the emulators. So, if you are running on an emulator, it is almost certain you are missing the required services. People report getting it to work in emulators, but I have not tried myself. You can view than answers in this post, if you want to look at installing Google Play on an emulator.
Upvotes: 1