android - 添加适用于 Android 的 google place sdk 时出错[原因 : duplicate entry: com/bumptech/glide/GeneratedAppGlideModule. 类]

标签 android autocomplete google-places-api android-glide google-places

当我们尝试添加新的 Google Places SDK 时,我们在生成构建时遇到错误,

Cause: duplicate entry: com/bumptech/glide/GeneratedAppGlideModule.class

我的项目中使用的库:

  • com.github.bumptech.glide:glide:3.7.0
  • 编译“com.google.android.gms:play-services-maps:16.0.0”
  • com.google.android.libraries.places:places-compat:1.0.0

enter image description here

最佳答案

Glide setup and configuration 集成 Glide 的应用程序必须添加一个 AppGlideModule 实现

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.9.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
 }

Finally, you should keep AppGlideModule implementations in your proguard.cfg:

 -keep public class * extends com.bumptech.glide.module.AppGlideModule
 -keep class com.bumptech.glide.GeneratedAppGlideModuleImpl

关于android - 添加适用于 Android 的 google place sdk 时出错[原因 : duplicate entry: com/bumptech/glide/GeneratedAppGlideModule. 类],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54747825/

相关文章:

web-services - Google Places Autocomplete(包含在 Places Details 中)使用 session token 时不会触发 SKU

ruby-on-rails - Google Places ActiveResource

Java/Android : Passing Intent Extras, 然后在另一个方法上使用它

java - 在 MySQL SELECT 查询中无法正确识别从 Android POST 请求传递到服务器中 PHP 的字符串

android - 如何在Android中制作类似于滚动壁纸的背景图像?

reactjs - 如何使用 react 测试库测试 Material ui 自动完成

android - 为什么我们在 Logcat 中看到 Spotify 日志?

ruby - 不要将所需文件包含到 vim omnicompletion 中

javascript - 自动完成在我的 asp.net mvc 中不显示任何 CSS

javascript - 了解 Google Places Photos API 的响应