Я следил за внедрением Firebase, но, похоже, что-то не так с моим build.gradle
.
Код MainActivity
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user !=null){
// user is signed in
}else {
//user is signed out
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(Arrays.asList(
new AuthUI.IdpConfig.GoogleBuilder().build(),
new AuthUI.IdpConfig.FacebookBuilder().build(),
new AuthUI.IdpConfig.TwitterBuilder().build(),
new AuthUI.IdpConfig.GitHubBuilder().build(),
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.PhoneBuilder().build()))
.build(),
RC_SIGN_IN);
}
}
Код Build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:26.0.+'
//24.2.0
compile 'com.android.support:appcompat-v7:26.0.+'
//v7:24.2.+
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
//FireBase Dependency
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
// 27.0.3
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
defaultConfig {
// ...
resConfigs "en" // And any other languages you support
}
implementation 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-database:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.1'
compile 'com.google.android.gms:play-services-auth:15.0.1'
compile 'com.google.firebase:firebase-firestore:17.0.1'
compile 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
}
Я аннулировал кэш и перезапустил несколько раз, но, похоже, это не помогло
Есть ли какие-то другие зависимости, которые я пропустил?