Shinlone
Shinlone

Reputation: 11

How to exclude dependency from project() dependency in Gradle

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

enter image description here

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

enter image description here

Upvotes: 1

Views: 4940

Answers (1)

RaGe
RaGe

Reputation: 23795

I would try a slightly different syntax:

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

Upvotes: 2

Related Questions