0

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
Andrei
  • 137
  • 4
  • 12

3 Answers3

2

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

Community
  • 1
  • 1
stewjacks
  • 471
  • 6
  • 12
  • I've edited the first post with some possible errors. Thanks ! – Andrei May 12 '14 at 15:48
  • Are you trying to run your app in the emulator or on a device? Try it on a device and see if it works. – stewjacks May 12 '14 at 16:12
  • I tried.. the same white screen, then I used on emulator to see if there are any errors. Those error at OpenGL does not effect it? – Andrei May 12 '14 at 16:16
  • No, those issues are probably not associated with Maps. Take a look at the entire logcat output or go `adb logcat | grep Maps` to see if there are warnings related to maps. Shadow and I are trying to point out that this is probably an API key issue, though. Logcat will confirm this – stewjacks May 12 '14 at 16:17
  • Is there any difference if the maps actully starts or not? I mean, I don't have the google services on my emulator right now, will it make difference if I install it and show the same white screen like on a real device? Thanks ! – Andrei May 12 '14 at 16:30
  • The emulator doesn't play nice with play services. For maps I test on a device. If you're getting a grey/white screen with the Google logo at the bottom it's a key issue. If you're getting a white screen with nothing then it could be any manner of issue. The MapFragment/MapView could not be inflated. You could have a play services version error. Without a proper logcat dump with relevant info it's a shot in the dark unfortunately – stewjacks May 14 '14 at 16:28
  • I'm getting the white screen with logo, so it's a key issue, that's what all said. But how do you recommand me to obtain the key? Thanks ! – Andrei May 14 '14 at 17:37
  • Sounds like a key issue then. I've updated the answer again to include a URL to follow verbatim – stewjacks May 15 '14 at 19:06
1

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.

Shadow
  • 6,864
  • 6
  • 44
  • 93
  • I know that there are ywo keys, but the difference if I'm right is that debug key is used on tests and when you publish app to store, it should be used release key. Am I right? . Btw, I didn't find the keystore in bin as you said. I generated my key using cmd in java/jre8 folder. Is that ok? – Andrei May 12 '14 at 16:06
  • yes you are right. whether you export your application and signed? @Andrei – Shadow May 12 '14 at 16:23
0

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 !

quicksilver
  • 171
  • 1
  • 4