2017-08-27 36 views
6

使用Facebook,两者单独工作正常,但当我都在一个项目同时采用火力数据库帐户套件时,它给无差错没有静态方法ZZB - 当用户火力数据库和Facebook帐户套件

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)

我使用dependencies-

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' 

我坚持要找到解决方案。

+0

你是否找到解决这个问题的办法? –

+0

是的,我给出了下面的答案。请检查。 –

回答

1

尝试添加Firebase核心库。

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

不起作用,它现在仍然是相同的错误。 –

0

我在多次失败后找到我的解决方案。 在依赖使用那些 -

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' 

,然后在build.gradle

添加multiDexEnabled true再添加这些行buildscript - 在那里

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

也加入allprojects -

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

然后创建一个类像 -

public class AppUtils extends Application { 

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

AndroidManifest添加这个类名喜欢 -

android:name=".AppUtils" 

这是我解决这一问题的过程。

相关问题