Reputation: 137
I'm trying to work with Google Maps API v2, and I've read a lot of questions and answers and nothing so far. It works, never crashes, but it shows only a white display with Google maps logo in the bottom left corner and in the bottom right corner the 2 buttons for zoom out/in, and that's all. Why?
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.descoper.rom"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.descoper.rom.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.descoper.rom.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="permission_name"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomActionBarTheme"
>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.descoper.rom.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:installLocation="preferExternal" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.descoper.rom.Galerie"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.descoper.rom.GalerieAdapter"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.descoper.rom.Item"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.descoper.rom.Romania"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.descoper.rom.Maps"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<!-- Goolge Maps API Key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="Here is my generated API KEY " />
</application>
</manifest>
maps.xml:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
Maps.java:
package com.descoper.rom;
import android.app.Activity;
import android.os.Bundle;
public class Maps extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.maps);
}
}
logcat - possible error:
05-12 11:44:06.210: E/JavaBinder(729): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
05-12 11:45:01.070: E/libEGL(52): called unimplemented OpenGL ES API
05-12 11:45:01.070: E/libEGL(52): called unimplemented OpenGL ES API
05-12 11:45:01.080: E/libEGL(52): called unimplemented OpenGL ES API
05-12 11:45:01.080: E/libEGL(52): called unimplemented OpenGL ES API
05-12 11:45:01.080: E/SurfaceFlinger(52): glCheckFramebufferStatusOES error -507375258
05-12 11:45:01.080: E/SurfaceFlinger(52): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
05-12 11:45:01.080: E/libEGL(52): called unimplemented OpenGL ES API
05-12 11:45:01.080: E/libEGL(52): called unimplemented OpenGL ES API
Upvotes: 0
Views: 2653
Reputation: 171
Came across this issue. Make sure you install the release build and not the debug build. Debug builds aren't signed with your certificate which is why Maps fails to load. Took me a while to figure it out !
Upvotes: 0
Reputation: 481
Possible duplicate: Google maps Android only white screen is shown
This isn't a complete answer because there isn't really enough information given to debug. You should look at the warnings in logcat when you start the map, and post them so we can better debug as they usually tell you what the issue is. Have you registered whatever debug/production keystore SHA1 keys in the API Console under Android Maps API V2? Sometimes the issue is as simple as registering under Maps API V2 instead of Android Maps API V2. Also, it takes a little while (~15 minutes to an hour) for this to go live.
Also, make sure you don't have more than one API key registered to your keystore. You can have more than one package associated with a SHA1 key and vice versa, but you can't have more than one API key associated with a keystore SHA1
As a guide, follow this link verbatim: https://developers.google.com/maps/documentation/android/start
Upvotes: 2
Reputation: 6899
Which type of keystore you are using?
Generally there are two keys debug key and release key. while signing app, you want to use release key. For that you want to compare that with signed apk
Step 1:
Say for example your apk name is A and you are signing and creating a keystore for A.apk ie A.keystore will be created in some drive location.Let's consider it in E drive.
step 2:
Now locate to jdk in C drive(Considering for windows and assigning C drive)
C:\Program Files\Java\jdk1.7.0\bin>keytool -list -v -keystore E:\A.keystore -alias A
So it will create SHA-1 fingure print
copy and paste that in google map console, it wll generate a key.use it in maps.
Upvotes: 1