Android: добавить новый тип сборки – невозможно найти подходящую конфигурацию проекта.Android

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Android: добавить новый тип сборки – невозможно найти подходящую конфигурацию проекта.

Сообщение Anonymous »

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'.


Подробнее здесь: https://stackoverflow.com/questions/507 ... of-project
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»