-1

Please comment why it was downvoted and what should i add more Here is logcat output

06-02 15:21:04.520 7986-7986/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             Process: com.example.mayurn.engineeringhelper, PID: 7986
                                             java.lang.NoSuchMethodError: No static method zzcx(Landroid/content/Context;)Lcom/google/android/gms/internal/zzbth; in class Lcom/google/android/gms/internal/zzbth; or its super classes (declaration of 'com.google.android.gms.internal.zzbth' appears in /data/app/com.example.mayurn.engineeringhelper-2/base.apk:classes12.dex)
                                                 at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                 at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                 at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                 at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                 at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
                                                 at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
                                                 at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                 at android.app.ActivityThread.installProvider(ActivityThread.java:5187)
                                                 at android.app.ActivityThread.installContentProviders(ActivityThread.java:4782)
                                                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4722)
                                                 at android.app.ActivityThread.access$1600(ActivityThread.java:153)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1408)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:148)
                                                 at android.app.ActivityThread.main(ActivityThread.java:5451)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

In my Build.gradle (Module:app) I have

compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

And in build.gradle(Project) I have this

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.0.0'
}
}

allprojects {
    repositories {
        jcenter()
    }
}

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

I have seen these answers

  1. Firebase database dependency crashes app
  2. After upgrading to google play services 8.4.0 my app crashes on startup
  3. No static method zzUr() in Firebase when I try to use Analytics with Notifications

All they suggest to use the same version of firebase services. You can see that I have already done that, the only version of ui-database and ui-storage are different.

Also short note:-MultiDex is enabled and minify is disabled.

BhalchandraSW
  • 714
  • 5
  • 13

2 Answers2

1

The problem in your dependencies is that your firebaseui library is not compatible with firebase library.

Check Compatibility with Firebase / Google Play Services Libraries.

You want 1.2.0 version of firebaseui and therefore you must update firebase library to 10.2.0+.

BhalchandraSW
  • 714
  • 5
  • 13
0

In your build.gradle you need to add all the dependencies -

dependencies {
    // FirebaseUI Database only
    compile 'com.firebaseui:firebase-ui-database:1.2.0'

    // FirebaseUI Auth onl
    compile 'com.firebaseui:firebase-ui-auth:1.2.0'

    // FirebaseUI Storage only
    compile 'com.firebaseui:firebase-ui-storage:1.2.0'

    // Single target that includes all FirebaseUI libraries above
    compile 'com.firebaseui:firebase-ui:1.2.0'
 }

If this doesn't fix your error then you might want to add these files as well

  compile "com.android.support:design:23.2.1"
  compile "com.android.support:customtabs:23.2.1"
  compile "com.android.support:cardview-v7:23.2.1"

I hope after doing all this, your issue should be long gone. Btw for more information on this, you can check out the Git repo of Firebase - https://github.com/firebase/FirebaseUI-Android#installation actually this has all the details.

Vikas Meena
  • 322
  • 3
  • 20