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
Android: добавить новый тип сборки – невозможно найти подходящую конфигурацию проекта. ⇐ Android
Форум для тех, кто программирует под Android
1732079075
Anonymous
Android Studio 3.1, Gradle 4.4
Иерархия моего проекта
-app
-common
build.gradle
common — это библиотека Android для моего проекта.
В результате получается [b]settings.gradle[/b]:
include ':app', ':common'
Вот мой [b]app/build.gradle[/b]
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')
}
И мой проект успешно построен и запущен. Отлично.
Теперь я хочу добавить новый [b]buildType = "debugTest"[/b]
Итак, вот мой [b]app/build.gradle[/b]
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'.
Подробнее здесь: [url]https://stackoverflow.com/questions/50738174/android-add-new-buildtype-unable-to-find-a-matching-configuration-of-project[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия