Android 設定真的好多好雜好歡樂,最近開發遇到下述問題:

More than one file was found with OS independent path 'META-INF/ASL2.0'

 

Google 查了一下,是因為有引用很多library,裡面有檔案會衝突,所以就寫下述的語法在build.gradle(Module:app)中來排解這些衝突,解法就是乾脆就不引入:

packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
    exclude("META-INF/*.kotlin_module")
}

 

截圖如下:

 

Reference:

https://stackoverflow.com/questions/44342455/more-than-one-file-was-found-with-os-independent-path-meta-inf-license

文章標籤
全站熱搜
創作者介紹
創作者 葛瑞斯肯 的頭像
葛瑞斯肯

葛瑞斯肯樂活筆記

葛瑞斯肯 發表在 痞客邦 留言(0) 人氣(322)