更新地点时获取清单合并失败错误 Api

Getting Manifest merger failed Error While Updating Places Api

嘿,我的 Google 地点 Api 不工作,我在日志中看到他们要求更新地点 Api .. 所以我尝试这样做,他们要求添加一些依赖项

implementation 'com.google.android.libraries.places:places:2.2.0'
implementation 'com.google.android.libraries.places:places-compat:2.2.0'

当我添加这两个依赖项时,我得到了这个错误

Merging Errors: Error: Attribute activity#com.google.android.libraries.places.widget.AutocompleteActivity@theme value=(@style/PlacesAutocompleteThemeOverlay) from AndroidManifest.xml:21:13-66 is also present at AndroidManifest.xml:18:13-61 value=(@style/PlacesAutocompleteOverlay). Suggestion: add 'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:16:9-23:20 to override. app main manifest (this file), line 20 Error: Attribute activity#com.google.android.libraries.places.widget.AutocompleteActivity@windowSoftInputMode value=(stateAlwaysVisible|adjustPan) from AndroidManifest.xml:22:13-71 is also present at AndroidManifest.xml:19:13-55 value=(adjustResize). Suggestion: add 'tools:replace="android:windowSoftInputMode"' to <activity> element at AndroidManifest.xml:16:9-23:20 to override. app main manifest (this file), line 21

但是,如果我只添加一个依赖项,那么它就可以工作了,但是我在代码中需要这两个依赖项请帮助我在过去的 4 小时内尝试解决它:(

根据 Google 的文档,Android 的 Places SDK 版本 2.0.0 现在依赖于 AndroidX。为了保持兼容性,您必须迁移您的项目以使用 AndroidX.

您应该删除其中一个实现

com.google.android.libraries.places:places:2.2.0

com.google.android.libraries.places:places-compat:2.2.0

根据你想做什么,你必须选择你想要实现的库

https://developers.google.com/places/android-sdk/client-migration