API_UNAVAILABLE Google API client

2020-02-06 08:52发布

Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null}

I am trying to implement the basic g+ login in my app and I have followed the steps exactly like in Drive API for Android Getting Started.

Has anyone seen this error before?

When I click on the signin button I get the prompt to select my google account. Once I select the account nothing happens in my app.

The logs are below:

E/MDM     (32664): [33508] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null}
I/LoadedApk(32664): getClassLoader :dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.android.location.provider.jar", zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/data/app/com.google.android.gms-2/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.gms-2/lib/arm64, /vendor/lib64, /system/lib64]]]
I/SurfaceFlinger( 3100): id=2396 Removed SurfaceView (-2/9)
D/LocationInitializer(29281): Restart initialization of location
W/ActivityManager( 3499): userId = 0, bbcId = -10000
W/ActivityManager( 3499): NORMAL SET : dst_category = 701, src_allowCategory = 0,701-1023

2条回答
家丑人穷心不美
2楼-- · 2020-02-06 09:33

Same happened here.I thought it was activated, but, as i did, you probably haven't activated Google+ Api on the Google Api Console.

Click on the APIs you want and you'll find a button "activate" on the top.

Wait a few minutes, close your app and try again. It will probably work.

查看更多
SAY GOODBYE
3楼-- · 2020-02-06 09:37

As per Google docs for API_UNAVAILABLE:

One of the API components you attempted to connect to is not available. The API will not work on this device, and updating Google Play services will not likely solve the problem. Using the API on the device should be avoided.

Also check if you have put the correct settings and keys in the manifest. Try on different device if possible. If you post the code how you are creating the client, device type/os etc, it might have narrow down the problem.

查看更多
登录 后发表回答