2017-11-11 128 views
0

當我嘗試編譯這個庫 'org.brunocvcunha.instagram4j:instagram4j:1.5' 我得到任務':app:transformResourcesWithMergeJavaResForDebug'的執行失敗。 >

執行失敗的任務 ':應用程序:transformResourcesWithMergeJavaResForDebug'。 >發現多個文件與操作系統無關的路徑'log4j.properties'

任何想法如何解決這個問題?我創建了一個新項目來測試這個庫,所以這是我嘗試編譯的第一個庫。

我已經通過互聯網搜索,只有我發現這個錯誤的是要補充一點:

packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
} 

但是,這並不幫助。任何想法如何解決這個錯誤?提前致謝。

回答

0

您可以嘗試排除log4j.properties這個:

packagingOptions { 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'log4j.properties' 
    // or use: 
    // exclude 'path/of/log4j/log4j.properties' 
} 

或者,你可以嘗試從以下行的依賴性不包括log4j的:

dependencies { 
    ... 
    compile ('org.brunocvcunha.instagram4j:instagram4j:1.5') { 
    exclude group: "log4j", module: "log4j" 
    } 
} 
相關問題