gpt4 book ai didi

android - 工具 : replace not replacing in Android manifest

转载 作者:IT老高 更新时间:2023-10-28 12:58:21 25 4
gpt4 key购买 nike

我正在使用具有许多不同库依赖项的 gradle 项目并使用新的 list 合并。在我的 <application />标签我已经这样设置了:

<application tools:replace="android:icon, android:label, android:theme, android:name"
android:name="com.example.myapp.MyApplcation"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/application_name"
android:logo="@drawable/logo_ab"
android:theme="@style/AppTheme"
>
....
</application>

但我收到错误消息:

/android/MyApp/app/src/main/AndroidManifest.xml:29:9        Error:
Attribute application@icon value=(@drawable/ic_launcher) from AndroidManifest.xml:29:9
is also present at {Library Name} value=(@drawable/app_icon)
Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:26:5 to override

/android/MyApp/app/src/main/AndroidManifest.xml:30:9 Error:
Attribute application@label value=(@string/application_name) from AndroidManifest.xml:30:9
is also present at {Library Name} value=(@string/app_name)
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:26:5 to override

/android/MyApp/app/src/main/AndroidManifest.xml:27:9 Error:
Attribute application@name value=(com.example.myapp.MyApplication) from AndroidManifest.xml:27:9
is also present at {Another Library}

Suggestion: add 'tools:replace="android:name"' to <application> element at AndroidManifest.xml:26:5 to override

/android/MyApp/app/src/main/AndroidManifest.xml:32:9 Error:
Attribute application@theme value=(@style/AppTheme) from AndroidManifest.xml:32:9
is also present at {Library Name} value=(@style/AppTheme)
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:26:5 to override

最佳答案

像这样声明你的 list header

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourpackage"
xmlns:tools="http://schemas.android.com/tools">

然后您可以在您的应用程序标签中添加以下属性:

<application
tools:replace="icon, label" ../>

例如我需要替换图标和标签。祝你好运!

关于android - 工具 : replace not replacing in Android manifest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25981156/

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