2017-08-27 71 views
6

przy użyciu Facebook, zarówno sam działa w porządku, ale gdy używam zarówno w tym samym czasie w projekcie zestawu konta Firebase-bazy dać ERROR-Nie statyczna metoda ZZB - gdy użytkownik Firebase-bazy danych i konta facebook Zestaw

java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzac; or its super classes (declaration of 'com.google.android.gms.common.internal.zzac' appears in /data/app/com.neccargo-2/split_lib_dependencies_apk.apk:classes14.dex)

Używam Zależności

compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{ 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 

    compile 'com.android.support:appcompat-v7:26.+' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.volley:volley:1.0.0' 
    compile 'com.android.support:recyclerview-v7:26.+' 
    compile 'com.android.support:cardview-v7:26.+' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.facebook.android:account-kit-sdk:4.+' 
    compile 'com.karumi:dexter:4.1.1' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.daimajia.slider:library:[email protected]' 
    compile 'fr.avianey.com.viewpagerindicator:library:[email protected]' 
    compile 'com.wdullaer:materialdatetimepicker:2.3.0' 
    compile 'com.jakewharton:butterknife:8.7.0' 
    compile 'com.flaviofaria:kenburnsview:1.0.7' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    testCompile 'junit:junit:4.12' 
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0' 
} 

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

siedzę około znaleźć rozwiązanie.

+0

znalazłeś rozwiązanie tego problemu? –

+0

tak, daję odpowiedź poniżej. Proszę sprawdzić. –

Odpowiedz

1

Spróbuj dodać bibliotekę jądra Firebase.

compile 'com.google.firebase:firebase-core:10.0.1' 
+0

nie działa, nadal jest to ten sam błąd. –

0

Po wielu błędach znajduję rozwiązanie. W zależności używać tych -

compile 'com.google.firebase:firebase-core:11.0.1' 
compile 'com.google.firebase:firebase-database:11.0.1' 
compile 'com.android.support:multidex:1.0.1' 
compile 'com.google.android.gms:play-services:11.0.1' 

a następnie dodać multiDexEnabled true w build.gradle

następnie dodać te linie w buildscript -

classpath 'com.google.gms:google-services:3.1.0' 
classpath 'com.google.firebase:firebase-plugins:1.0.4' 

tam również dodać w allprojects -

maven { 
    url "https://maven.google.com" 
} 

Następnie należy utworzyć klasę jak -

public class AppUtils extends Application { 

    @Override 
    public void onCreate() { 
     super.onCreate(); 
     FirebaseApp.initializeApp(getApplicationContext()); 
    } 
} 

dodać tę nazwę klasy w AndroidManifest jak-

android:name=".AppUtils" 

to proces przezwyciężyć ten problem.