Hetal Patel
Hetal Patel

Reputation: 127

Google api map V2 not displaying with signed apk in device

I am displaying MAP using google map Api V2 i successfully displayed it in device when am running through my PC but now i am signing my application via export signed apk and made as .keystore and .apk and it made a certificate and now i am using that apk file and runnning the application but the map does not displayed just showing white screen, even i made a release key using http://developer.android.com/tools/publishing/app-signing.html and i succesfully performed all the steps given in the link but then too the map is not displaying, please help.

Thanks.

Upvotes: 3

Views: 12453

Answers (6)

Sudhir
Sudhir

Reputation: 103

To find out the Android SHA1 fingerprint for release keystore, follow these steps:

Open terminal Change the directory to the JDK bin directory, mine was jdk1.7.0_05 (could be different for you).

cd C:\Program Files\Java\jdk1.7.0_05\bin

Next we have to run the keytool.exe. Use the following line to get the SHA1 fingerprint.

keytool -list -v -keystore {keystore_name} -alias {alias_name}

Example:

keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test

It will prompt for a password. Enter the password, you will get the SHA1 and MD5 fingerprint.

Upvotes: 0

MohanRaj S
MohanRaj S

Reputation: 2008

I Faced the Same Problem,Finally Got a Solution, Kindly check your Developer Account,It have permission for Api key generation follow this steps to show your map in google play signed apk

1. Create the Api using Debugging SHA1.
(eg)F0:0F:F0:0F:F0:0F:F0:0F:F0:0F:F0:0F:F0:0F:F0:0F:F0:0F:F0:0F;com.blabla.app
2.Create the Api using Relased SHA1 from appname.keystore.
(eg)F2:83:F2:83:F2:83:F2:83:F2:83:F2:83:F2:83:F2:83:F2:83:F2:83;com.blabla.app
 you have an option to create on this api in single textfield in developerId api console page.

This kind of option are available only in developer account.Try it.Thank you.
Please refer the following Image if u have any doubt.

enter image description here

Upvotes: 1

Pratik Dasa
Pratik Dasa

Reputation: 7449

You must need to create new map api key with your newely create keystore and put it on Google Map Api Console page. Use below command:

PATH OF YOUR KEYTOOL FILE/keytool -list -v -keystore YOURKEYSTORENAME

You will get SHA-1, save it. Go to Google api console page, create new Android key using this SHA-1 and put newely created key into your app. It will work for sure.

Upvotes: 3

Anil M H
Anil M H

Reputation: 3342

try this

1.first create the .APK file in eclipse in the console as shown this see this image

Console

2.copy the SHA1 key and then create the API Key using this .Google APIs Console

3 and past the API key into ur project and then create the APK file

Upvotes: 0

Alex Muni
Alex Muni

Reputation: 474

you need to sign your maps with release key ;) you signed your map with debug.keystore

how to get a Google Maps API v2 release key

Google Maps v2 Getting started

My public class VentanaMapa extends FragmentActivity when private GoogleMap mMap;

status = GooglePlayServicesUtil
            .isGooglePlayServicesAvailable(getBaseContext());
    Intent intentErrorMapa = null;
    switch (status) {
    case ConnectionResult.SUCCESS:
        SupportMapFragment SupportMap = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mMap = SupportMap.getMap();
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

        mMap.getUiSettings().setZoomControlsEnabled(true);
        mMap.getUiSettings().setCompassEnabled(true);

        new ObtenerEnvio().execute(_empAlbaran, _codAlbaran.toString(),
                _lineaAlbaran.toString());
        mMap.setMyLocationEnabled(true);
        break;

    case ConnectionResult.SERVICE_MISSING:
        Toast.makeText(VentanaMapa.this, R.string.ErrorMapaServiceMissing,
                Toast.LENGTH_LONG).show();
        break;

    case ConnectionResult.SIGN_IN_REQUIRED:
        Toast.makeText(VentanaMapa.this, R.string.ErrorMapaSignRequired,
                Toast.LENGTH_LONG).show();
        break;

    case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
        Toast.makeText(VentanaMapa.this, R.string.ErrorMapaServiceUpdate,
                Toast.LENGTH_LONG).show();
        break;
    case 999:
        Toast.makeText(VentanaMapa.this, R.string.ErrorCargarMapa,
                Toast.LENGTH_LONG).show();
        break;
    }

My Map.xml:

`<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="fill_parent"
    android:layout_height="100dp"
    android:layout_above="@+id/ImageButtonAnteriorMapa"
    android:layout_alignParentTop="true" />

</RelativeLayout>

1) create a release key, for sign your app. SHA1 that you have you need to go to Google Api console. Create new Android key like SHA1_number;your.package 2) with this key you need to add in your manifest like: <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your_key_for_release" /> your put that code before </application> that's it. check logcat to see exactly which message you recive from Google Maps

Upvotes: 2

marshallino16
marshallino16

Reputation: 2671

In the Google API console have you add your signed sha1 Key and change it in your Manifest.xml ?

Because, signed and debug keystore and completely different, with Eclipse, when you Export your project as an Android Application, you choose a keystore and before clicking finish, there is a sha1 key at the bottom of the window. You've to add this specific key in the API Console.

Upvotes: 0

Related Questions