Can't run android application with release key

2019-09-16 01:55发布

问题:

I developed a Simple Applicaiton , and generated a Google API Map key.

I provided the api console with a signature created from the debug keystore.

When I got ready for release , I created a releasekeystore , and signed the application with it .

Then I used the releasekeystore to generate a new fingerprint , and updated the google api console.

However when i run my application locally , it gives an error saying

10-10 14:37:42.571: E/Google Maps Android API(12369): Ensure that the following correspond to 

what is in the API Console: Package Name: com.evento.simplemap, API Key: key, Certificate Fingerprint: 16C737A318E97CFF92EE4C1A1A72A785CBaa0C03

This fingerprint is the fingerprint obtained from the debug.keystore.

How should I force the releasekeystore to work (whose fingerprint I have uploaded in the console).

I am sorry all of this is too complicated for me , as I had no previous experience with google map api . Please give me some insight

回答1:

The key shown in log in not valid kay to access Google Maps API. Please check that the kay is active or not.



回答2:

First of all create your fingerprint proper, using your signed apk keystore not debug.keystore.

Then generate map api key, there you must need to give your application's package name, example below:

Your SHA1 fingerprint; Your App Package Name(com.test) and click on generate new android key.

Be sure that you have activated Google map api v2 active .

It will generate a key, copy that key and put it in your project's Android manifest file in reaplace with your debug key. Then run it will work.