Android Studio 3.1, Gradle 4.4
Моя иерархия проектов
-app
-common
build.gradle
common
- это Android-библиотека для моего проекта.В результате settings.gradle :
include ':app', ':common'
Здесь мой 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')
}
И мой проект успешно построен изапустить.Хорошо.
Теперь я хочу добавить новый buildType = "debugTest"
Итак, вот мой 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 {
}
}
Но теперь я получаю ошибку при сборке проекта:
gradlew clean build
Вот сообщения об ошибках:
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'.