小编Har*_*vić的帖子

登录Google Firebase帐户时出现错误16问题

如您所见,这是我的代码,大部分是从google文档中复制的,用于google登录认证。问题是,当我单击登录按钮时,它向我抛出一个错误“ 16:”,很抱歉张贴图像,我在张贴代码时遇到问题,希望有人能帮助我解决这个问题。

**依赖关系//对于firebase

    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-crash:15.0.2'
    implementation 'com.firebase:firebase-client-android:2.3.1'
    implementation 'com.google.firebase:firebase-storage:15.0.2'
    implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.android.gms:play-services-auth:16.0.0'**

    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_welcome_screen);
    onCreate();
    SignInButton signInButton = findViewById(R.id.sign_in_button);
    signInButton.setSize(SignInButton.SIZE_STANDARD);
    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .build();
    mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
    mAuth = FirebaseAuth.getInstance();
    signInButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            signIn();
        }
    });
}

private void signIn() {
    Intent signInIntent = mGoogleSignInClient.getSignInIntent();
    startActivityForResult(signInIntent, RC_SIGN_IN);
}

private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
    try {
        GoogleSignInAccount account = …
Run Code Online (Sandbox Code Playgroud)

android google-authentication firebase

2
推荐指数
1
解决办法
2509
查看次数

标签 统计

android ×1

firebase ×1

google-authentication ×1