Pas*_*nik 6 android maven google-places-api jcenter
我正在尝试jcenter()从我的项目中删除它,因为它已被弃用。但我使用的com.google.android.libraries.places:places:2.4.0依赖项是当前最新版本,官方文档中概述了这一点。有趣的是,当我尝试构建项目时它失败了,因为它找不到 dependency com.android.volley:volley:1.1.1。我不直接在我的项目中使用此依赖项,但我发现它是库内的传递依赖项places。
当我执行时gradlew app:dependencies我可以看到这样的情况:
+--- com.google.android.libraries.places:places:2.4.0
| +--- androidx.appcompat:appcompat:1.0.0 -> 1.3.1 (*)
| +--- androidx.cardview:cardview:1.0.0 (*)
| +--- androidx.fragment:fragment:1.1.0 -> 1.3.6 (*)
| +--- androidx.lifecycle:lifecycle-extensions:2.1.0 -> 2.2.0 (*)
| +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
| +--- com.android.volley:volley:1.1.1 FAILED
| +--- com.google.android.datatransport:transport-api:2.2.0 -> 3.0.0 (*)
| +--- com.google.android.datatransport:transport-backend-cct:2.3.0 -> 3.0.0 (*)
| +--- com.google.android.datatransport:transport-runtime:2.2.3 -> 3.0.0 (*)
| +--- com.google.android.gms:play-services-base:17.2.1 -> 17.5.0 (*)
| +--- com.google.android.gms:play-services-basement:17.0.0 -> 17.5.0 (*)
| +--- com.google.android.gms:play-services-location:17.0.0 -> 18.0.0 (*)
| +--- com.google.android.gms:play-services-maps:17.0.0
| | +--- androidx.fragment:fragment:1.0.0 -> 1.3.6 (*)
| | +--- com.google.android.gms:play-services-base:17.0.0 -> 17.5.0 (*)
| | \--- com.google.android.gms:play-services-basement:17.0.0 -> 17.5.0 (*)
| +--- com.google.android.gms:play-services-tasks:17.0.0 -> 17.2.0 (*)
| +--- com.google.auto.value:auto-value-annotations:1.6.2
| \--- com.google.code.gson:gson:2.8.5 -> 2.8.7
Run Code Online (Sandbox Code Playgroud)
因此,com.google.android.libraries.places:places:2.4.0使用过时的库com.android.volley:volley:1.1.1。有趣的是,仅从版本开始com.android.volley托管。并且版本仅在以下位置可用:https ://mvnrepository.com/artifact/com.android.volley/volley/1.1.1mavenCentral1.2.01.1.1Bintray
我的顶级配置:
buildscript {
ext.kotlin_version = '1.5.21'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Run Code Online (Sandbox Code Playgroud)
jcenter那么,当 Google 都没有这么做的时候,我该如何迁移呢?或者我错过了什么?
现在,您可以手动单独包含 Volley 依赖项,并从 Places 依赖项中排除 1.1.1 版本。
implementation('com.google.android.libraries.places:places:2.4.0') {
exclude group: 'com.android.volley'
}
implementation 'com.android.volley:volley:1.2.0'
Run Code Online (Sandbox Code Playgroud)
正如您所指出的,Volley 现在位于 Maven Central 上,因此您还需要包含该mavenCentral()存储库。
| 归档时间: |
|
| 查看次数: |
1018 次 |
| 最近记录: |