我必须将旧项目迁移到AndroidX,并将所有依赖项更新为最新版本,但唯一的依赖项在清单合并中出错。
仅此依赖项出现错误错误:清单合并失败并出现多个错误,请参阅日志:
implementation 'com.google.android.libraries.places:places-compat:2.1.0'
我的意思是,当我删除它时,错误消失了。
这是我的 app.build
apply plugin: 'com.android.application' android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.pertamina.tbbm.rewulu.ecodriving.mobil" minSdkVersion 16 targetSdkVersion 28 versionCode 12 versionName "5.5.1" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } dexOptions { javaMaxHeapSize "8g" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1' implementation 'com.google.android.material:material:1.0.0' implementation 'com.sothree.slidinguppanel:library:3.4.0' implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' implementation 'com.google.android.gms:play-services-auth:17.0.0' implementation 'com.google.android.gms:play-services-maps:17.0.0' implementation 'com.google.android.libraries.places:places:2.1.0' implementation 'com.google.android.libraries.places:places-compat:2.1.0' implementation 'com.facebook.android:facebook-android-sdk:4.42.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2' implementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } apply plugin: 'com.google.gms.google-services'
还有 Manifest.xml
我真的不知道自己的配置有什么问题。.整天看网上,却一无所获...
注意::当我迁移到AndroidX时,按Refractor>迁移到AndroidX,会弹出警告消息说“在项目中找不到用法”。
谢谢
答案 0 :(得分:1)
尝试从您的应用程序build.gradle文件中删除实施'com.google.android.libraries.places:places:2.1.0'
,它应该可以正常工作
答案 1 :(得分:1)
打开应用程序清单( AndroidManifest.xml
)并单击 Merged Manifest.
,检查下面的图像:
从图像中您可以在右列中看到错误,尝试解决该错误。它可能会帮助某些人遇到相同的问题。了解更多here
答案 2 :(得分:0)
您是否尝试过如下替换依赖项?
implementation "com.google.android.libraries.places:places:1.1.0"