【问题标题】:Class file for com.google.android.gms.internal.zzbfm not found未找到 com.google.android.gms.internal.zzbfm 的类文件
【发布时间】:2018-08-08 04:03:18
【问题描述】:

我正在开发一个使用 Google Maps 和 Googla Places API 的 android 应用程序。但运行项目后,出现如下错误: See error

我在项目中添加的依赖项是:

implementation fileTree(dir: 'libs', include: ['*.jar'])

    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.github.glomadrian:MaterialAnimatedSwitch:1.1@aar'
    implementation 'com.firebase:geofire-android:2.3.1'
    implementation 'com.github.d-max:spots-dialog:0.7@aar'
    implementation 'com.android.support:appcompat-v7:27.0.1'

    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.android.support:design:27.0.1'
    implementation 'com.android.support:cardview-v7:27.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.google.android.gms:play-services:11.8.0'

    testImplementation 'junit:junit:4.12'

【问题讨论】:

  • 查看this的答案。

标签: android google-maps-api-3 android-gradle-plugin dependencies google-places-api


【解决方案1】:
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'

将上述库的依赖版本更新到此

implementation 'com.google.firebase:firebase-database:+'
implementation 'com.google.firebase:firebase-auth:+'
implementation 'com.google.firebase:firebase-core:+'
implementation 'com.google.android.gms:play-services-maps:+'

不要添加所有依赖项删除 implementation 'com.google.android.gms:play-services:+' 使用需要的单个依赖项,例如 implementation 'com.google.android.gms:play-services-maps:+'

【讨论】:

  • Google 建议不要在版本中使用+。 >注意:使用动态依赖项(例如,palette-v7:23.0.+)可能会导致意外的版本更新和回归不兼容。我们建议您明确指定库版本(例如,palette-v7:27.1.1)。以上引自documentation
  • @parekhkruti26 这是一个解决方案,实际上是 android studio 错误,有时会导致此问题,使用上述解决方案会加载最新的 SDK 并开始工作
  • 这可能是一种解决方法,但不是推荐的方法。
  • @MJM 实施上述解决方案后,应用程序没有显示任何错误,但是当我尝试转到 MapsActivity 时,应用程序关闭。它显示应用程序已停止。我现在该怎么办?
  • @SadmanKabirSoumik 检查 Logcat 中的错误日志,在此处更新
猜你喜欢
  • 2019-02-14
  • 1970-01-01
  • 2020-04-20
  • 2018-11-10
  • 2016-10-30
  • 2018-06-10
  • 2016-03-23
  • 2018-07-17
  • 1970-01-01
相关资源
最近更新 更多