Android Studio uggestion: add 'tools:replace="android:theme" 问题
来源:互联网 发布:plc通信 十六进制数据 编辑:程序博客网 时间:2024/06/17 13:28
项目中开发了一个库以供其他模块引用,完成后运行报如下问题:
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:8:5-23:19 to override.
网上搜索了资料,原因大致如下:
AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的android:icon和android:theme),则此时会合并失败,并报上面的错误。
解决方式为:在Manifest.xml的application标签下添加tools:replace=”android:icon, android:theme”(多个属性用,隔开,并且记住在manifest根标签上加入xmlns:tools=”http://schemas.android.com/tools”)
然而我加上之后并没有预想的效果,不造为什么,最后用了一个变通的方式:将主题加在Activity上,同时还必须去掉application标签主题引用。运行不在报错。
记录一下如果以后有更好的解决方式在更新。
欢迎访问博客: https://leonhua.github.io/ ,查看更多文章。
0 0
- Android Studio uggestion: add 'tools:replace="android:theme" 问题
- Studio uggestion: add 'tools:replace="android:theme"
- tools:replace="android:icon, android:theme"
- AndroidStudio出现tools:replace="android:theme"问题
- Suggestion: add 'tools:replace="android:label"'
- 使用Android Studio时报错 Manifest merger failed...Suggestion: add 'tools:replace="android:label"'
- add 'tools:replace="android:value"' to <meta-data> element问题的解决
- Suggestion: add 'tools:replace="android:icon"' to element
- Android Studio Gradle tools:replace="android:icon"错误
- AndroidStudio出现tools:replace="android:icon"问题
- AndroidManifest 文件合并错误-->tools:replace="android:value"问题
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml
- Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xm
- Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:28:5
- Manifest merger failed Suggestion: add 'tools:replace=“Android:value”' to <meta-data> element at And
- Python高级编程技巧实战 基于Python项目与面试题讲解
- zookeeper zkCli.sh的基本使用方法
- 【JS】限制特殊字符
- 8 Queens Chess Problem
- GO panic和recover的用法
- Android Studio uggestion: add 'tools:replace="android:theme" 问题
- Android SurfaceView
- float型数据写入eeprom,以及对eeprom操作的注意事项
- PTA测试基础题--统计个位数字
- Android基础--0系列开题
- Web前端——CSS复习1(3.25)
- Android主题换肤 无缝切换
- 某定时任务系统的方案设计------软件系统设计能力很重要
- Netty学习(二)-Helloworld Netty