gpt4 book ai didi

java - 当我尝试使用新的地方兼容时出现问题

转载 作者:行者123 更新时间:2023-12-02 10:10:16 24 4
gpt4 key购买 nike

我尝试使用新的placesApi,我遵循此文档https://developers.google.com/places/android-sdk/client-migration#place-picker-deprecation ,当我运行我的应用程序时,android studio 返回此

错误:类型 com.google.android.libraries.places.internal.lm 被引用为 com.google.android.libraries.places.internal.fm 中的接口(interface)”

还有这个:“由以下原因引起:com.android.builder.dexing.DexArchiveBuilderException:无法处理 C:\Users\14155709.gradle\caches\transforms-1\files-1.1\places-1.0.0.aar\2f69114c5b5de9392ef400dc02f6f031\jars\classes.jar"

当我输入以下内容时,这个问题就开始了:实现'com.google.android.libraries.places:places-compat:1.0.0'

还有这个:实现“com.google.android.libraries.places:places:1.0.0”

我需要一些工具,我尝试在谷歌上搜索,但没有找到注释,请帮助我。

这是我的 gradle 项目:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

这是我的 gradle 应用程序:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.motoja.motojapassageiro"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
//maps places
implementation 'com.google.android.libraries.places:places-compat:1.0.0'
//implementation 'com.android.support:cardview-v7:28.0.0'
//implementation 'com.google.android.gms:play-services-places:16.0.+'
implementation 'com.google.android.libraries.places:places:1.0.0'
//google-play
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
// Required only if Facebook login support is required
implementation 'com.facebook.android:facebook-android-sdk:4.40.0'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'


}
apply plugin: 'com.google.gms.google-services'

最佳答案

这两个依赖项可能会相互冲突:

// implementation "com.google.android.libraries.places:places-compat:1.1.0"
implementation "com.google.android.libraries.places:places:1.1.0"

places-compat 包装器通常不是必需的 - 最好将代码重构到新库。

关于java - 当我尝试使用新的地方兼容时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55050034/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com