1

this is my module app. I think the firebaseUi dependency is the one that is causing the error, but Iam not sure about it. someone help please.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'

    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.firebaseui:firebase-ui-database:6.0.2'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.4'

    implementation 'com.google.firebase:firebase-core:16.0.4'

    implementation 'androidx.cardview:cardview:1.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

The app crushes, and this is part of the stack Trace that is produced

 11-11 11:19:05.890 18032-18032/? E/Zygote: MountEmulatedStorage()
11-11 11:19:05.890 18032-18032/? E/Zygote: v2
11-11 11:19:05.900 18032-18032/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
11-11 11:19:06.320 18032-18032/com.example.mytasks E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.mytasks, PID: 18032
    java.lang.NoClassDefFoundError: com.google.firebase.auth.internal.zzae
        at com.google.firebase.auth.FirebaseAuth.zzcb(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
        at com.google.firebase.auth.internal.zzj.<init>(Unknown Source)
        at com.google.firebase.auth.zzp.create(Unknown Source)
willy
  • 101
  • 1
  • 9
  • Have you tried using the [latest versions](https://firebase.google.com/docs/android/setup#available-libraries) of these dependencies? Also take note that `com.google.firebase:firebase-core` is deprecated in favor of `com.google.firebase:firebase-analytics:17.2.1`. – samthecodingman Nov 15 '19 at 04:17
  • try this link https://stackoverflow.com/a/52172596/8040930 – sourabh kaushik Nov 15 '19 at 05:05

2 Answers2

1

My guess is you missed some dependencies in your root-level (project-level) Gradle file. Check if you have all these:

buildscript {

  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
  }

  dependencies {
    // ...

    // Add the following line:
    classpath 'com.google.gms:google-services:4.3.3'  // Google Services plugin
  }
}

allprojects {
  // ...

  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
    // ...
  }
}
Bach Vu
  • 2,298
  • 1
  • 15
  • 19
  • I've got all those added. but still the error remains – willy Nov 15 '19 at 04:31
  • @willy According to this thread https://github.com/invertase/react-native-firebase/issues/2122, try increasing your firebase version to 17+ – Bach Vu Nov 15 '19 at 04:39
0

Apparently you seem to be using the old versions that doesn't support androidx.

The solution here is to use the latest versions.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'

    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.firebaseui:firebase-ui-database:6.1.0'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-database:19.2.0'

//  No longer required implementation 'com.google.firebase:firebase-core:17.2.1' 

    implementation 'com.google.firebase:firebase-analytics:17.2.1'
    implementation 'androidx.cardview:cardview:1.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

Please refer to the latest versions here,

sanjeev
  • 1,664
  • 19
  • 35