Android Studio 3.1, Gradle 4.4 < /p>
иерархия моего проекта < /p>
-app
-common
build.gradle
< /code>
common< /code> - Android LIB для моего проекта.
как результат stens.gradle < /strong>: < /p>
include ':app', ':common'
< /code>
Here my app/build.gradle
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
configBuildType(delegate, RELEASE_APP_NAME, null, RELEASE_API_BASE_URL)
signingConfig signingConfigs.release
}
debug {
configBuildType(delegate, DEBUG_APP_NAME, DEBUG_APP_ID_SUFFIX, DEBUG_API_BASE_URL)
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':common')
}
< /code>
And my project success build and run. Nice.
Now I want to add new buildType = "debugTest"
So here my app/build.gradle
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
configBuildType(delegate, RELEASE_APP_NAME, null, RELEASE_API_BASE_URL)
signingConfig signingConfigs.release
}
debug {
configBuildType(delegate, DEBUG_APP_NAME, DEBUG_APP_ID_SUFFIX, DEBUG_API_BASE_URL)
}
debugTest {
}
}
< /code>
But now I get error when build project:
gradlew clean build
< /code>
Here error messages:
WARNING: The option 'android.enableD8' is deprecated and should not be used anymore.
Use 'android.enableD8=true' to remove this warning.
It will be removed in AGP version 3.3.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalDebugTest'.
> Could not resolve all task dependencies for configuration ':app:debugTestRuntimeClasspath'.
> Could not resolve project :common.
Required by:
project :app
> Unable to find a matching configuration of project :common:
- Configuration 'debugApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debugTest' and found incompatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
- Configuration 'debugRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debugTest' and found incompatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
- Configuration 'releaseApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debugTest' and found incompatible value 'release'.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
- Configuration 'releaseRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debugTest' and found incompatible value 'release'.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
Подробнее здесь: https://stackoverflow.com/questions/507 ... of-project