android studio 引入arr的问题
生活随笔
收集整理的這篇文章主要介紹了
android studio 引入arr的问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為什么80%的碼農都做不了架構師?>>> ??
1.合并AndroidManifest錯誤
D:\AndroidStudioProjects\androidrongflysip\rongflymqtt\src\main\AndroidManifest.xml:96:9-45 Error: Attribute application@icon value=(@drawable/ic_launcher) from AndroidManifest.xml:96:9-45 is also present at [:app-debug:] AndroidManifest.xml:29:9-50 value=(@mipmap/ic_launcher_circle). Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:93:5-1486:19 to override. See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. :rongflymqttrocessDevDebugManifest FAILED Error:Execution failed for task ':rongflymqttrocessDevDebugManifest'. > Manifest merger failed : Attribute application@icon value=(@drawable/ic_launcher) from AndroidManifest.xml:96:9-45 is also present at [:app-debug:] AndroidManifest.xml:29:9-50 value=(@mipmap/ic_launcher_circle). Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:93:5-1486:19 to override.
AS的Gradle插件默認會啟用Manifest Merger Tool,若Library項目中也定義了與主項目相同的屬性(例如默認生成的android:icon和android:theme),則此時會合并失敗,并報上面的錯誤。
解決辦法有2種
方法1:?在Manifest.xml的application標簽下添加tools:replace="android:icon, android:theme"(多個屬性用,隔開,并且記住在manifest根標簽上加入xmlns:tools="http://schemas.android.com/tools",否則會找不到namespace哦)
多個沖突這么寫?
方法2:?在build.gradle根標簽上加上useOldManifestMerger true (懶人方法)
?
再同步Gradle,問題解決。
?
2.android xml 命名空間錯誤
這種自動查找的寫法,可能會報
No resource identifier found for attribute 'srcCompat' in package 'com.feinno.rongfly' E:\fetionworkspace\androidrongflysip\rongflymqtt\build\intermediates\exploded-aar\publibrary-debug\res\layout\z_recyclerview.xml這是因為自動查找會找當前包下的命名空間,會找到主端的包名下。
所以引入的庫aar需要直接命名成自己的包名
3.主題設置問題
如果使用了 v7的一些空間,而項目主題沒有使用v7的主題則會報
Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class android.support.v7.widget.CardView改成v7的主題就可以了
轉載于:https://my.oschina.net/ldhy/blog/739910
總結
以上是生活随笔為你收集整理的android studio 引入arr的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在阿里云上进行Docker应用的自动弹性
- 下一篇: iOS系统库头文件中NS_AVAILAB