简体   繁体   中英

How to exclude dependency from project() dependency in Gradle

While using a project as a dependency, how can I exclude some jars selectively?

在此处输入图片说明

Here's what I tried:

compile project(':OneSDK') {
    exclude module: 'alipaySingle-20160223'
    exclude module: 'utdid4all-1.0.4'
}

I get this Error:

Error:(93, 0) Gradle DSL method not found: 'exclude()' Possible causes

  • The project 'YoukeApplication' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Apply Gradle plugin

在此处输入图片说明

I would try a slightly different syntax:

compile(project(':OneSDK')) {
    exclude module: 'alipaySingle-20160223'
    exclude module: 'utdid4all-1.0.4'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM