5

I've a core module that is the base of my app. This module have 2 flavors. When I try import it in my app module that has no flavor, I receive the following error:

> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
   > Could not resolve project :core.
     Required by:
         project :app
      > Project :app declares a dependency from configuration 'implementation' to configuration 'internalRelease' which is not declared in the descriptor for project :core.

That's my core build.gradle configuration:

android {
    compileSdkVersion 27

    publishNonDefault true

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }

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

    flavorDimensions 'target'

    productFlavors {
        internal {
            dimension "target"
        }

        external {
            dimension "target"
        }
    }

    dexOptions { preDexLibraries true }
}

And here is how i'm importing this module in my app module build.gradle:

 implementation project(path: ':core', configuration: 'internalRelease')
Tgo1014
  • 536
  • 1
  • 7
  • 17

1 Answers1

-3

Try using simply implementation project(':core') see link here

Jantzilla
  • 638
  • 1
  • 7
  • 19