Android:java.lang.NoSuchMethodError:没有静态方法zzy。

时间:2017-08-18 17:45:48

标签: java android android-studio firebase

我做了很多研究,我尝试了几件事,例如检查我的所有导入是否都在同一个版本中,取消安装Android Studio或将所有文件复制到另一个项目,我仍然得到这个我的FirebaseList出现时出现问题。

我真的不知道该怎么做。

这是我得到的错误

  Process: com.anonymous, PID: 11244
                                                                       java.lang.NoSuchMethodError: No static method zzy(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.anonymous-2/split_lib_dependencies_apk.apk:classes12.dex)
                                                                           at com.google.android.gms.internal.zzann.zzug(Unknown Source)
                                                                           at com.google.android.gms.internal.zzann.zzuf(Unknown Source)
                                                                           at com.google.firebase.storage.StorageReference.child(Unknown Source)
                                                                           at com.google.firebase.storage.FirebaseStorage.getReference(Unknown Source)
                                                                           at com.adriacabeza.scoregame.ListAdapter.<init>(ListAdapter.java:34)
                                                                           at com.adriacabeza.scoregame.MainActivity.onCreate(MainActivity.java:64)
                                                                           at android.app.Activity.performCreate(Activity.java:6760)
                                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2814)
                                                                           at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:154)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:6290)
                                                                           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)

这是我的gradle

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "com.anonymous"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }    }} 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'
})


testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.firebaseui:firebase-ui-storage:0.6.0'

compile 'com.android.support:design:25.3.1'
compile 'de.hdodenhof:circleimageview:2.1.0'

annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'}
apply plugin: 'com.google.gms.google-services'

这是我的Android Manifest

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adriacabeza.scoregame">
<uses-feature android:name="android.hardware.camera"
    android:required="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:fullBackupContent="false"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".CreateActivity"> </activity>
    <activity android:name=".LoginActivity" />

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.example1.android.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths"></meta-data>
    </provider>
    <meta-data android:name="com.google.android.geo.API_KEY"
        android:value="@string/api_key"/>
</application>

</manifest>

1 个答案:

答案 0 :(得分:0)

您正在使用最新的播放服务库'com.google.android.gms:play-services-auth:11.0.2'。在SDK管理器中更新 Google Play服务插件。然后清理并重建您的项目。

希望有所帮助:)