2016-11-23 4 views
5

Hallo Ich lerne Firebase von einem Udacity-Kurs zu verwenden. Ich habe diesen Fehler erhalten, als ich meine App gestartet habe und keine Ahnung davon habe. 11-23 16: 48: 34,995 3947-3947/com.google.firebase.udacity.friendlychatjava.lang.NoSuchMethodError: Keine virtuelle Methode zzait() Ljava/util/ArrayList; in der Klasse Lcom/Fehler?

E/AndroidRuntime: FATAL EXCEPTION: main 
Process: com.google.firebase.udacity.friendlychat, PID: 3841 
java.lang.NoSuchMethodError: No virtual method zzait()Ljava/util/ArrayList; 
in class Lcom/google/android/gms/auth/api/signin/GoogleSignInOptions; 
or its super classes (declaration of 'com.google.android.gms.auth.api.signin.GoogleSignInOptions' appears in /data/data/com.google.firebase.udacity.friendlychat/files/.jrebel/load-dexes/bundle12/libraries24.zip) 
at com.google.android.gms.auth.api.Auth$3.zza(Unknown Source) 
at com.google.android.gms.auth.api.Auth$3.zzp(Unknown Source) 
at com.google.android.gms.common.api.GoogleApiClient$Builder.addApi(Unknown Source) 
at com.firebase.ui.auth.util.CredentialsAPI.initGoogleApiClient(CredentialsAPI.java:147) 
at com.firebase.ui.auth.util.CredentialsAPI.<init>(CredentialsAPI.java:65) 
at com.firebase.ui.auth.ui.ChooseAccountActivity.onCreate(ChooseAccountActivity.java:102) 
at android.app.Activity.performCreate(Activity.java:6100) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112)     at com.zeroturnaround.jrebel.android.agent.JRebelInstrumentation.callActivityOnCreate(SourceFile:93) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2468) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2601) 
at android.app.ActivityThread.access$800(ActivityThread.java:178) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) 
at android.os.Handler.dispatchMessage(Handler.java:111) 
at android.os.Looper.loop(Looper.java:194) 
at android.app.ActivityThread.main(ActivityThread.java:5637) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372)  
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
11-23 16:48:35.176 3947-3975/com.google.firebase.udacity.friendlychatE/GED: Failed to get GED Log Buf, err(0) 

Kann mir jemand helfen?

UPDATE build.gradle

apply plugin: 'com.android.application' 

repositories { 
    mavenLocal() 
    maven { url 'https://maven.fabric.io/public' } 
    flatDir { 
     dirs 'libs' 
    } 
} 

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.1" 

    defaultConfig { 
     applicationId "com.google.firebase.udacity.friendlychat" 
     minSdkVersion 16 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 

    compile 'com.android.support:design:24.2.0' 
    compile 'com.android.support:appcompat-v7:24.2.0' 

    // Displaying images 
    compile 'com.github.bumptech.glide:glide:3.6.1' 
// Firebase 
    compile 'com.google.firebase:firebase-database:10.0.0' 
    compile 'com.firebaseui:firebase-ui-database:1.0.0' 

    // FirebaseUI Auth only 
    compile 'com.firebaseui:firebase-ui-auth:1.0.0' 

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

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

    // Firebase Auth 
    compile 'com.google.firebase:firebase-auth:10.0.0' 

} 
apply plugin: 'com.google.gms.google-services' 
+0

Können Sie Ihre Build.gradle Ihres App-Moduls posten? –

+0

Ich habe es gepostet. Bitte guck dir das an. –

+0

verweisen Sie auf diese https://github.com/udacity/and-nd-firebase –

Antwort

2

Dies wird höchstwahrscheinlich zwischen Firebase zu einer Version Inkompatibilität tun, und FirebaseUI. Ich stieß auf das gleiche Problem und verbrachte 30 bis 45 Minuten damit, es herauszufinden. Letztes Ende, was ich tat, um mit der „Firebase in einem Weekend“ Tutorial Gang zu halten war:

git checkout 1.04-firebase-auth-firebaseui-signin

Dies ist auf die Filiale an dieser Stelle im Tutorial wechseln. Es funktioniert gut danach.

Vielleicht nicht die ideale Antwort auf das Problem, aber Sie werden wieder mit dem Kurs.

9

Die Übereinstimmung der Versionen löst dies. Also, wenn Abhängigkeiten geändert

compile 'com.google.firebase:firebase-database:9.8.0' 
compile 'com.google.firebase:firebase-auth:9.8.0' 
compile 'com.firebaseui:firebase-ui-auth:1.0.0' 

In Kompatibilität mit Firebase/Google-Service Bibliotheken spielen, es

FirebaseUI Version Firebase/Play Services Version 

    1.0.0     9.8.0 

Spiele statt

compile 'com.google.firebase:firebase-database:10.0.0' 
compile 'com.google.firebase:firebase-auth:10.0.0' 
compile 'com.firebaseui:firebase-ui-auth:1.0.0' 

, welche die neueste verfügbare Feuerbasis Version ist für FirebaseUI Version, die App funktioniert gut

+1

Bestätigung: Ich habe Firebase-Abhängigkeiten bei '10.2.0' ausgeführt. Das Herunterstufen auf "10.0.1" (Ausführen von "Firebase-Ui-Auth" bei "1.1.1") behebt das Problem. – RedBassett

+0

das löste mein Problem, danke – mohnage7

1

Sie müssen nur hinzufügen: compile 'com.google.android.gms: play-services-auth: x.x.x' (finden Sie die richtige Version here). Sie vermissten zu sagen, dass Sie auch Play-Services-Auth-Abhängigkeit hinzufügen müssen, damit die Google-Authentifizierung funktioniert.

Verwandte Themen