3

I have created a release keystore using the Eclipse IDE. I signed it using keytool and registered on Google Maps. I plugged in the key but my map doesn't show up.

Maps show up properly when I use the key associated with my debug keystore.

How can I diagnose this? I followed the same steps as i did with debug, for release.

UPDATE:

Here is my manifest file:

      <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.cancertrials" android:versionCode="1"
    android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
        <activity android:label="@string/app_name" android:name="splash">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".HomeActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden">
        </activity>
        <activity android:name=".moreactivity" android:label="@string/app_name">
        </activity>
        <activity android:name=".aboutmedtrust" android:label="@string/app_name">
        </activity>
        <activity android:name=".aboutclinical" android:label="@string/app_name">
        </activity>
        <activity android:name=".aboutglaxosmith" android:label="@string/app_name">
        </activity>
        <activity android:name=".termsofuse" android:label="@string/app_name">
        </activity>
        <activity android:name=".privacy" android:label="@string/app_name">
        </activity>
        <activity android:name=".feedback" android:label="@string/app_name">
        </activity>
        <activity android:name=".informationcancer" android:label="@string/app_name">
        </activity>
        <activity android:name="AdvanceSearchActivity" android:label="@string/app_name">
        </activity>
        <activity android:name="SearchingActivity"></activity>
        <activity android:name="AdvanceSearchTab1"></activity>
        <activity android:name="AdvanceSearchTab2"></activity>
        <activity android:name="DetailedActivity"></activity>
        <activity android:name="summary"></activity>
        <activity android:name="conditions"></activity>
        <activity android:name="description"></activity>
        <activity android:name="inclusion"></activity>
        <activity android:name="exclusion"></activity>
        <activity android:name="BookmarkActivity"></activity>
        <activity android:name="RecentActivity"></activity>
        <activity android:name="information"></activity>
    <uses-library android:name="com.google.android.maps"></uses-library>
    <activity android:name="Mapsactivity">
    </activity>
    <activity android:name="mapView"></activity>

</application>
    <uses-sdk android:minSdkVersion="3" />

</manifest> 
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
  • You have a ridiculous amount of activities. You also have the uses-library set twice, one of them inside an activity. I'm surprised that even compiles – Falmarri Nov 25 '10 at 17:16
  • You've got `ACCESS_FINE_LOCATION` in there twice, might be worth pulling one of those – Jimmy Nov 25 '10 at 17:22
  • Also try running it against an emulator that is on the Google APIs target (Use AVD manager to download extra targets) – Jimmy Nov 25 '10 at 17:23
  • See updated Manifest.xml. I removed the duplicate `ACCESS_FINE_LOCATION` and duplicate `uses-library`. Maps still don't appear... – Sheehan Alam Nov 25 '10 at 17:44

3 Answers3

2

Did you add the internet permission? This question is asked literally every day.

Falmarri
  • 47,727
  • 41
  • 151
  • 191
  • 1
    Yes, it is added. See my manifest file. Whats interesting is that when I use the key for my debug keystore the map appears. Only when I use my release keystore maps don't appear... – Sheehan Alam Nov 24 '10 at 16:29
0

So I encountered this problem myself yesterday and I resolved by manually signing the .apk

I assume you are using your private keystore and you have entered the release map key in your mapview (and other resources, as needed).

In order to do, you choose your projekt from Eclipse's project explorer (right click) -> Android Tools -> Export unsigned package. Save it where ever you like.

Open your terminal (I'm on a Windows 7 machine), cd into your jdk folder (NOT jre), cd further into bin\ .

Use following command: (Note that the " are required if you type a path)

        jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "path-to-your-keystore" "path-to-your-apk" <apk alias> -certs 

To verify the signing process do

jarsigner -verify "path-to-recently-signed-apk" -verbose 

(You can leave the verbose option out if you want). It will (hopefully) show jar verified (eventually it will warn you about entries without a validated certificate chain, that didnt matter in my case)

Then run zipalign:

zipalign -v 4 "path-to-signed-apk" "path-to-signed-and-aligned.apk"

Note that it will create a new apk, which is aligned to googles standards.

Install that apk and your maps should show up fine!

From: http://developer.android.com/tools/publishing/app-signing.html#ExportWizard

coernel
  • 79
  • 1
  • 9
0

You have to obtain a separate API key when signing with the release key store as your fingerprint changes.

Make sure to also install the .apk signed with the right key.

Update: What I meant is are you sure you sign your APK with the right key? That means are you sure you sign it with the release keystore when generating the APK?

When you are exporting it, are you actually really selecting the keystore with which to sign it?

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • I did obtain a separate API key associated with the release keystore. That is the key that doesn't work. When I swap it back with my debug keystore, everything is golden again. – Sheehan Alam Nov 25 '10 at 18:20
  • @Sheehan Alam: Updated my answer. – Octavian Helm Nov 25 '10 at 18:26
  • Yes, I have exported my APK with the correct release keystore. I sent the APK to my beta tester, who was unable to get the map. How can I run the release APK through Eclipse? I have a feeling Eclipse is running my debug APK, but using the release key... – Sheehan Alam Nov 25 '10 at 18:55
  • Interesting. When I select my release keystore it tells me: `Keystore was tampered with, or password was incorrect` – Sheehan Alam Nov 25 '10 at 19:21