android - Places API 设置在 build.gradle 设置期间出错
问题描述
我一添加
compile 'com.google.android.libraries.places:places:1.0.0'
它开始给我错误
Cause: duplicate entry: com/bumptech/glide/GeneratedAppGlideModule.class
我的 build.gradle 代码是
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.videep.carpool"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
}
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'
})
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.firebase:geofire-android:2.1.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.github.jd-alexander:library:1.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.libraries.places:places:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
解决方案
为 Glide 添加最新版本的依赖项。
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
这个问题在 glide 库中。它已在最新版本中修复。请检查链接以供参考。
推荐阅读
- javascript - 使用 Node 的“加密”模块时是否需要使用密钥派生?
- javascript - JavaScript:按常见项目字段组合项目值列表
- api - 将 LogMeIn Refresh Token Curl 转换为 Coldfusion
- java - 在 Java 对象中发送 Multipart 和 JSON 数据 - Spring Boot Rest
- python - 网上银行网页抓取
- google-cloud-platform - 有没有办法通过存储在 Google Cloud Storage 中的文本文档进行 grep?
- html - 寻找更简洁的语法来使用 css 网格重复模式的列?
- python - Python:类方法中的 *args 行为
- javascript - jQuery.val() 仅在使用 datepicker 的第二个事件上返回值
- flutter - 如何显示html的一部分?