【问题标题】:error cannot access zza after adding firestore添加firestore后错误无法访问zza
【发布时间】:2018-05-19 10:04:57
【问题描述】:

我在我的 gradle 中添加了 Firestore,当我正确同步它的同步时,但是当我运行项目时,我得到了这个错误。

error: cannot access zza class file for com.google.android.gms.common.internal.safeparcel.zza not found

这是我的 gradle 文件依赖项

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.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.sothree.slidinguppanel:library:3.4.0'
compile 'com.github.florent37:singledateandtimepicker:1.2.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.jakewharton:butterknife:8.7.0'
testCompile 'junit:junit:4.12'
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
compile 'com.chabbal:slidingdotsplash:1.0.2'

implementation 'com.google.firebase:firebase-firestore:16.0.0'

}

【问题讨论】:

    标签: android firebase build.gradle google-cloud-firestore


    【解决方案1】:

    要解决这个问题,请更改这行代码:

    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    

    //compile 'com.google.android.gms:play-services:15.0.1' //(Must be commented)
    compile 'com.google.android.gms:play-services-maps:15.0.1'
    

    也一定要使用:

    classpath 'com.google.gms:google-services:3.3.1'
    

    在您的build.gradle(项目)文件中。

    【讨论】:

    • 我已经更新了所有的 gradle 文件,现在我收到了这个错误 ------- 找不到 com.google.android.gms.internal.zzbgl 的类文件
    • 您是否还在文件末尾添加了apply plugin: 'com.google.gms.google-services'dependencies 结束?
    • 现在出现这个错误.....所有firebase库必须高于或低于14.0.0
    • 这意味着在您的依赖项中存在另一个较低版本的 firebase 依赖项。您确定您已正确更新所有 Firebase 吗?如果您不确定,请再次分享您的文件,包括所做的更改。
    • 请查看here所有正确版本。现在可以用了吗?
    【解决方案2】:

    Firebase 现在分发具有独立版本号的软件包,确保 build.gradle 上的所有软件包都是最新的

    将所有 google 依赖项更新为最新的,例如在您的问题中需要更新以下行,还将 complie 更改为 implementation

        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:cardview-v7:27.1.1'
    
    
        implementation 'com.google.android.gms:play-services:15.0.1'
        implementation 'com.google.android.gms:play-services-maps:15.0.1'
    
        implementation 'com.google.firebase:firebase-firestore:16.0.0'
    

    【讨论】:

      猜你喜欢
      • 2020-09-29
      • 2019-05-03
      • 2019-02-10
      • 1970-01-01
      • 2013-01-14
      • 2021-09-10
      • 2018-06-29
      • 2018-09-10
      • 2018-09-15
      相关资源
      最近更新 更多