ajay
ajay

Reputation: 916

Cant compile project with modules

I created an app with a library module but it's giving below build error:

app/build.gradle
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :module.
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :module.
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :module.
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :module.
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :module.

Tried various solutions but wasted many hours. Any resolutions would be highly appreciated!

Upvotes: 1

Views: 225

Answers (1)

Ajay Harwani
Ajay Harwani

Reputation: 26

I spent a lot of time on this issue and none of above solutions work for me. The names and number of build types were also exactly equal in both app and library project.

The only mistake I was making was - In library project's build.gradle, I was using line

    apply plugin: 'com.android.application'

While this line should be -

    apply plugin: 'com.android.library'

After making this change, this error got resolved.

Upvotes: 1

Related Questions