Module inclusion: not intended for consumption by other components - gradle:3.0.0-alpha2

Viewed 1324

Upgraded to:

  • Android Studio 3.0 Canary 2
  • com.android.tools.build:gradle:3.0.0-alpha2

I have a multi-module project (main app + sub modules)

Inclusion inside the main app:

dependencies {
    implementation project(path: ':testlib', configuration: 'default')
}

The testlib is defined as a simple android library project and works normally when included with gradle 2.3.0 and via compile project(path: ':testlib')

I get the following gradle error message:

Could not resolve all dependencies for configuration ':app:devDebug_signedCompileClasspath'. Selected configuration 'default' on 'project :testlib' but it can't be used as a project dependency because it isn't intended for consumption by other components.

What does "isn't intended for consumption by other components" mean in this context? The module is defined as an android library.

Here is the build.gradle of the testlib:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
    }
}

apply plugin: 'com.android.library'


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"


    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

What am I missing?

2 Answers
Related