Android Studio添加應用作為依賴時報錯Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: 及其解決方案


Error:Dependency MonthText:xlistview:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: E:\Androidcode\androidstudioproject\MonthText\xlistview\build\outputs\apk\xlistview-release-unsigned.apk

解決方案:把依賴庫的build.gradle文件中最上邊的

 錯誤: apply plugin: 'com.android.application'
改為: apply plugin: 'com.android.library'
還有:要刪除defaultConfig中的applicationId "com.limxing.xlistview"
這個報錯主要原因是因為依賴庫之前是一個獨立的應用,需要把它的設置為庫,而不是應用

刪除applicationId "com.limxing.xlistview"的原因是:applicationId 這是應用才有的id,庫則沒有,所以要刪除
解決方案引用自(原文地址):http://www.07net01.com/2015/08/917039.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM