java.lang.NoSuchMethodError:没有静态方法zzcx(Landroid / content

时间:2017-10-28 17:05:17

标签: android firebase firebase-realtime-database firebase-authentication firebase-cloud-messaging

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
testCompile 'junit:junit:4.12'

朋友帮助我解决此错误.. enter image description here

1 个答案:

答案 0 :(得分:0)

build.gradle

中添加此规则
compile 'com.google.firebase:firebase-analytics:10.0.1'
  

最新版本

build.gradle

中添加此规则
compile 'com.google.firebase:firebase-analytics:11.4.2'

并将所有firebase依赖关系版本更改为11.4.2

compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'

确保您已将这些规则添加到根级build.gradle

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.1.1' // google-services plugin
    }
}

allprojects {
    // ...
    repositories {
        // ...
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}