Zeyu Zheng Zeyu Zheng - 11 days ago 5
Android Question

google map authenticate failed, after package name changed

I have an android app with a Google map, everything works good.

In order to publish it in Google play, I changed the package name (old package com.exmaple..) from project----- Android tools---Rename Application Package

So, I going to generate a new API key with my new package name.

I changed manifest with the new key.

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxnew keyxxxxxxxxxxxxx" />


But, it did not work. It said authentication failed.
Is there any idea? Did I miss some steps?

Thanks in advance!

Answer

If you are saying that you have generated the new key using the API Console and changed the API key in your application as well as changed the package name in those two permissions:

<permission android:name="your.application.package.permission.MAPS_RECEIVE"  
            android:protectionLevel="signature"/>
<uses-permission android:name="your.application.package.permission.MAPS_RECEIVE"/>

Then try to remove your application complete from the phone, as application is usually saves the old key in the cache, and then try to re-install it.

Comments