[英]Android exclude jar from aar, there are classes.jar and lint.jar in appcompat-1.2.0.aar
有沒有辦法從 aar 中排除 jar? appcompat-1.2.0.aar 中有 classes.jar 和 lint.jar。 當我實施 'androidx.appcompat:appcompat:1.2.0'時,我想排除 lint.jar
當我放置實施“androidx.appcompat:appcompat:1.2.0”來構建 gradle 時,我自定義的 Lint 規則將不起作用。 因為appcomat.aar中有一個lint.jar,所以我想從appcomat.aar中排除lint.jar。
因為lint
只是 appcompat.aar 中的pom.xml
,所以 pom.xml 中沒有 lint 依賴性,所以我不能使用打擊代碼排除lint.jar
implementation('androidx.appcompat:appcompat:1.2.0') {
exclude group: 'androidx.appcompat', module: 'lint'
}
你可以使用類似的東西
configurations {
all*.exclude group: 'androidx.appcompat:appcompat', module: 'lint'
}
在您的應用程序級別 build.gradle 文件中。 這基本上排除了您不需要使用的庫中的一些模塊。
Group 指定您導入的依賴項的 package 名稱,module 指定您希望排除的特定模塊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.