I'm getting this error: "The specified authentication provider is not enabled for this Firebase.", even though I HAVE enabled the required providers

I'm getting this error: "The specified authentication provider is not enabled for this Firebase.", even though I HAVE enabled the required providers

拜托,有人帮助我。我只是不明白出了什么问题!我还在 app 文件夹中包含了 google-services.json 文件。拜托,非常感谢任何帮助。我对此有点生气。

具体错误是:

I/System.out: The specified authentication provider is not enabled for this Firebase.

这是我的 MainActivity.java class:

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Firebase mRef = new Firebase("https://<my-project>.firebaseio.com/");
            mRef.createUser("bobtony@firebase.com", "correcthorsebatterystaple", new Firebase.ValueResultHandler<Map<String, Object>>() {
            @Override
            public void onSuccess(Map<String, Object> result) {
                System.out.println("Successfully created user account with uid: " + result.get("uid"));
            }
            @Override
            public void onError(FirebaseError firebaseError) {
                // there was an error
                System.out.println(firebaseError.getMessage());
            }
        });
    }
}

FirebaseActivity.java class:

public class FirebaseActivity extends android.app.Application{
    @Override
    public void onCreate() {
        super.onCreate();
        Firebase.setAndroidContext(this);
        // other setup code
    }

}

.

清单:

<uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:name=".FirebaseActivity"
        android:theme="@style/AppTheme" >
        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

build.gradle(应用):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "<myId>"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'com.google.firebase:firebase-core:9.0.0'
    compile 'com.google.firebase:firebase-database:9.0.0'
}
apply plugin: 'com.google.gms.google-services'

build.grade(项目):

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

此外,这是登录方式选项卡:

http://i.imgur.com/rGXrj9S.png

如果您还在看这篇文章,感谢您抽出时间阅读本文。拜托,一点点帮助。

您的代码看起来像是在使用旧版 (< 3.0.0) 的 Firebase,因此您可能需要在 https://www.firebase.com/login/ instead of the Firebase 3 console. Alternatively, this is how you create a password account with Firebase 3: https://firebase.google.com/docs/auth/android/password-auth#create_a_password-based_account

使用旧版控制台