【问题标题】:Firebase Error: W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned GmsFirebase 错误:W/BiChannelGoogleApi:[FirebaseAuth:] getGoogleApiForMethod() 返回 Gms
【发布时间】:2018-06-07 00:27:12
【问题描述】:

这是我的注册活动。我正在尝试使用 Firebase 创建一个 createUserWithEmailAndPassword 并向用户的个人资料添加一些详细信息,例如全名、地址和电话号码。在使用电子邮件和密码创建用户时,我想在分配给新用户的“用户”数据库中的唯一 ID 下添加用户配置文件。

public void signUpButtonClicked(View view) {

    if (!TextUtils.isEmpty(email_text) && !TextUtils.isEmpty(pass_text)) {
        mAuth.createUserWithEmailAndPassword(email_text, pass_text).addOnCompleteListener(new OnCompleteListener<AuthResult>() {

            public void onComplete(@NonNull Task<AuthResult> task) {
                if (task.isSuccessful()) {
                    String user_id = mAuth.getCurrentUser().getUid();
                    DatabaseReference current_user = mDatabase.child(user_id);
                    current_user.child("Email").setValue(email_text);
                    current_user.child("Full name").setValue(fullName);
                    current_user.child("Nickname").setValue(nick);
                    current_user.child("Address").setValue(fullAdd);
                    current_user.child("Phone Number").setValue(phone);

                    Toast.makeText(MainActivity.this, "You are now REGISTERED", Toast.LENGTH_LONG).show();
                    Intent userProfile = new Intent(MainActivity.this, MenuActivity.class);
                    startActivity(userProfile);

                } else {
                    email.setError(null);
                    pass.setError(null);
                }
            }
        });
   }

这就是我的 build.gradle 的样子。

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.firebaseui:firebase-ui-database:1.0.1'
    implementation 'com.android.support:cardview-v7:26.1.0'
    compile 'com.cepheuen.elegant-number-button:lib:1.0.2'

    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
}
apply plugin: 'com.google.gms.google-services'

它不会崩溃,但它也不会做任何事情。它只是记录这个错误。

12-26 12:12:53.194 4484-4522/com.example.example.example W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
12-26 12:12:56.766 4484-4484/com.example.example.example  W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
12-26 12:12:57.943 4484-4522/com.example.example.example  W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
12-26 12:13:03.621 4484-4522/com.example.example.example W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
12-26 12:13:11.635 4484-4522/com.example.example.example W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms

【问题讨论】:

    标签: android firebase firebase-realtime-database firebase-authentication


    【解决方案1】:

    尝试在手机或模拟器中降级 Firebase 版本或更新 Goole play 和 Play 服务。

    implementation 'com.google.firebase:firebase-auth:11.4.2'
    implementation 'com.google.firebase:firebase-database:11.4.2'
    implementation 'com.firebaseui:firebase-ui-database:3.1.0'
    

    或 Firebase 版本 10.2.6

    【讨论】:

    • 只会发生这种情况:W/IInputConnectionWrapper:非活动 InputConnection 上的 finishComposingText W/DynamiteModule:未找到 com.google.firebase.auth 的本地模块描述符类。
    • 当您降级 firebase 版本时,您也必须降级 google play services 版本。\
    • W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() 返回 Gms 此错误通常在最新的 Firebase 版本中发现。因此,降级是解决该问题的一种选择
    • 成功了!唯一的问题是我仍然无法继续,因为我认为 Firebase 不会接受数据到“用户”孩子中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-08
    • 2019-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多