? ? 最近剛換公司,eclipse項目,我要導(dǎo)入到AS中,話說我都1年多沒做過這種事情了,話說還有公司用eclipse嗎?一頓報錯,一頓該。PS:最少我鬧心的是,竟然編碼形式是GBK.
? 1.Suggestion: add 'tools:replace="android:icon"' to element
? AndroidManifest.xml:21:9-42 Error:Attribute application@icon value=(@drawable/ic_lauch) from AndroidManifest.xml:21:9-42is also present at [xx.xx:xx:unspecified] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).Suggestion: add 'tools:replace="android:icon"' toelement at AndroidManifest.xml:18:5-144:19 to override.
? ?AndroidManifest.xml:24:9-44 Error:Attribute application@theme value=(@style/AppBaseTheme) from AndroidManifest.xml:24:9-44is also present at [xx.xx:xx:unspecified] AndroidManifest.xml:15:9-40 value=(@style/AppTheme).Suggestion: add 'tools:replace="android:theme"' toelement at AndroidManifest.xml:18:5-144: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 這方法有的版本不適用(網(wǎng)上提供的方法,未實踐)
2、安裝apk的時候報錯,提示信息如下:
Failed to finalize session : INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113
解決方案:
android{ splits{ abi {enable true ?reset() ? include'x86','armeabi-v7a' ? universalApk ? true}}
