PLACES_API_INVALID_APP error from Android Play Pla

2020-03-15 01:19发布

I am trying Google Place Autocomplete Example from https://github.com/googlesamples/android-play-places.

I have put the correct API key at the correct place. I knew it because when I put a random string invalid API key I will get a different error.

So after I put the correct API key, I run the app in both real device and simulator. Both devices gave me this error:

Status{statusCode=PLACES_API_INVALID_APP, resolution=null}

What causes this error and how to fix it?

8条回答
欢心
2楼-- · 2020-03-15 02:06

Follow my steps:

1> Creating one new projects on Google Developer Console

2> API Manager > Credentials > New Credentials > API Key > Android Key > Press Create Button & Generate API KEY

Here, Creating key without applying package of application & SHA fingerprint is working in any application

MUST REMEMBER:

Enable Google Places API for Android

查看更多
Luminary・发光体
3楼-- · 2020-03-15 02:07

Although I have enable Android Place API from developer console but i came across this error:

Status{statusCode=PLACES_API_INVALID_APP, resolution=null}

Then I go to developer console and select my project registered earlier, and follow the option of "Get Place API key" for my project. I resolved it this way.

查看更多
爷的心禁止访问
4楼-- · 2020-03-15 02:08

Make sure that you have the API meta-data placed in Manifest.xml file

 <meta-data android:name="com.google.android.geo.API_KEY" android:value="You API Key Here"/>
查看更多
▲ chillily
5楼-- · 2020-03-15 02:10

In my case SHA-1 certificate fingerprint was for debug build only, I added release SHA-1 key also. Now it's working.

Make sure you use the exact packageName and valid SHA-1 key for debug as well as release app

查看更多
forever°为你锁心
6楼-- · 2020-03-15 02:12

Status{statusCode=PLACES_API_INVALID_APP, resolution=null}

it means your api key invalid so create API key with your Package name and SHA Fingerprint

STEPS fot Creating API KEY

1.Get information about your app's certificate (SHA fingerprient).

2.Register a project in the Google Developers Console

3.Add the Google Places API as a service for the project, and create an API key.

4.Add the key to your app manifest.

查看更多
等我变得足够好
7楼-- · 2020-03-15 02:17

I was getting the 'PLACES_API_INVALID_APP' even after posting my release SHA1. After trying everything I found out my release app was not even signed with the SHA1 I was getting from the keystore. So I did this:

1.Go to google play console

2.Release Management > App Signing > App signing certificate

3.Copy the SHA1 of App signing certificate and paste in google api console's credential page

Now you are good to go! Sadly it is not documented anywhere currently.

查看更多
登录 后发表回答