应用程序无法正常工作和java.lang.NoSuchMethodError

时间:2017-03-22 12:43:49

标签: android android-studio firebase

我是android studio和这里的新手。

我的应用程序无法在Android模拟器上运行。它说申请已停止。 当我看到android监视器时,我看到了这个错误:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ads.firebase, PID: 4296
java.lang.NoSuchMethodError: No virtual method zzahj()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/app/com.raykos.firebase-1/split_lib_dependencies_apk.apk:classes32.dex)
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:91)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

我的build.grande是:

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.google.firebase:firebase-database:10.0.1'
compile 'com.android.support:customtabs:25.3.0'
compile 'com.android.support:palette-v7:25.3.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.android.support:support-vector-drawable:25.3.0'
compile 'com.google.firebase:firebase-auth:10.0.1'

testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.0'

1 个答案:

答案 0 :(得分:1)

您必须使用与其他Firebase和Google Play图书馆兼容的FirebaseUI版本。 table of compatible versions包含在文档中。在您的情况下,您应该使用firebase-ui:1.1.1。

同时确保您的模拟器图片包含最新版本的Google Play服务。运行模拟设备时,您可以转到设置&gt;查看安装的Google Play服务版本。应用并选择Google Play服务。