1。运行signingReport,获取sha1
A3:8C:26:5D:0A:42:5A:C4:F0:C0:4A:FE:AA:8D:31:F7:76:7C:A1:39
Variant: debug
Config: debug
Store: C:\Users\gysgogo\.android\debug.keystore
Alias: AndroidDebugKey
MD5: 0B:63:BA:DC:B8:8E:58:D4:7A:34:BE:C8:39:96:EE:01
SHA1: A3:8C:26:5D:0A:42:5A:C4:F0:C0:4A:FE:AA:8D:31:F7:76:7C:A1:39
SHA-256: 92:81:AD:4D:56:BA:62:6A:C8:0E:83:EF:F4:0E:A2:04:DE:BD:AD:21:DE:FB:41:18:FA:DA:CE:1B:66:22:BF:EC
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gysgogo.myproject">
3。获取客户端ID:
621243190890-auj4jgcmva200np43n104s2fmdvu2um7.apps.googleusercontent.com
GoogleSignInOptions gso = new GoogleSignInOptions.
Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestIdToken("621243190890-auj4jgcmva200np43n104s2fmdvu2um7.apps.googleusercontent.com")
.build();
GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(LoginActivity.this, gso);
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, 200);
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
GoogleSignInAccount account = null;
try {
account = task.getResult(ApiException.class);
String email = account.getEmail();
String displayName = account.getDisplayName();
String id = account.getId();
xUri photoUrl = account.getPhotoUrl();
} catch (ApiException e) {
e.printStackTrace();
}
DEVELOPER_ERROR com.google.android.gms.common.api.ApiException:10: