Jitpack發佈Android庫出現Direct local .aar file dependencies are not supported when building an AAR

原文:Jitpack發佈Android庫出現Direct local .aar file dependencies are not supported when building an AAR - Stars-One的雜貨小窩

問題描述

由於我項目中某個Module引用了本地的aar文件,導致出現了此問題

> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :ocr project caused this error: /home/jitpack/build/ocr/libs/ocrsdk.aar

解決方法

把引用的implementation改爲provided即可,如下圖所示

網上找到了大都是是要去改setting.gradle,實際上改了還發現出現了其他錯誤。。。

如果想要驗證是否還有錯誤,可以通過Gradle右側的菜單來觸發發佈aar的操作

實際上,我測試的發佈aar,還是出現了報錯,不過是資源文件裏的某個顏色定義找不到,但用Jitpack上打包則正常,就沒有過於深究原因了

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章