android - 针对应用程序组件工厂的清单合并失败
问题描述
我是初学者,第一次使用 MapActivity,我的项目正在生成一些标题为“清单合并失败”的错误,并建议在 android 清单文件中添加一行
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:12:5-41:19 to override.
这是清单文件中的代码
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
tools:replace="android:appComponentFactory"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key"/>
<activity
android:name=".MapsActivity"
android:label="@string/title_activity_maps">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
但是在清单文件夹中添加建议的行后,它产生了一些不同的错误,如下所示
解决方案
推荐阅读
- git - 尝试初始化合并请求源时,Repo init 失败
- python - 如何比较字典值和熊猫数据框?
- android - 如何处理android单活动设计模式中的片段?
- date - 在 oracle 中为选择查询结果日期添加天数
- c - scanf("%d/%d%c%d/%d", &num1, &denom1, &sign, &num2, &denom2); 继续在控制台扫描用户输入
- flutter - 如何获得未来的权利
>> 在颤振中? - java - Java - 字符串拆分
- apache-kafka - Flink Kafka Sink org.apache.kafka.common.errors.UnsupportedVersionException ERROR
- performance - 如何计算网速?
- javascript - 如何使用 redux-toolkit 中的 createSlice 方法在不同的 reducer 函数中使用单个动作类型