今天升級友盟推送庫慢味,遇到了一些編譯問題澈蚌,在此做個簡單的記錄。
升級廠商通道時日月,出現(xiàn)了Manifest merger failed with multiple errors, see logs問題袱瓮,但是console中并無進一步的信息。
根據(jù)stackOverflow中提示爱咬,查看Merged Manifest尺借,并未看到error的輸出,只有一些warning信息精拟。參考 https://stackoverflow.com/questions/35842955/manifest-merger-failed-with-multiple-errors-in-android-studio
最終根據(jù)錯誤提示燎斩,使用命令 gradlew processDebugManifest --stacktrace打印出具體的報錯信息虱歪。
可以看到關鍵錯誤是huawei-basttb和hms:ui有沖突的內(nèi)容,其中huawei-basttb是推送庫中要刪除的舊包栅表。全局搜索后在某個底層包里找到了舊版本華為廠商通道的引用笋鄙。
一個不小心,導致折騰了這么久怪瓶。謹記教訓萧落,升級時小步走,慢慢驗證洗贰,不要急找岖。
編譯錯誤時,通過命令行敛滋,加上--stacktrace是個找到錯誤日志的好方法宣增。
與標題不相關的編譯問題:
升級common庫到9.4.0時,出現(xiàn)了Could not find common-9.4.0.jar (com.umeng.umsdk:common:9.4.0)的錯誤矛缨。信息如下:
> Could not find common-9.4.0.jar (com.umeng.umsdk:common:9.4.0). Searched in the following locations: https://maven.aliyun.com/nexus/content/repositories/jcenter/com/umeng/umsdk/common/9.4.0/common-9.4.0.jar Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
嘗試取消proxy不能解決爹脾。后來查看阿里云的倉庫文檔,發(fā)現(xiàn)其maven庫有更新箕昭,具體見https://maven.aliyun.com/mvn/guide 灵妨。將工程build.gradle中https://maven.aliyun.com/nexus/content/repositories/jcenter等地址升級到最新地址解決。
參考文檔
AndroidManifest 清單文件合并時出現(xiàn) 【quires a placeholder substitution but no value for <xxx> is provided.】問題
AndroidManifest清單文件合并失敗 Error:Execution...Manifest merger failed with multiple errors, see logs
Manifest merger failed with multiple errors最終極的解決方式
https://stackoverflow.com/questions/35842955/manifest-merger-failed-with-multiple-errors-in-android-studio