Ошибка очистки пакета React-native ./gradlew. Не удалось разрешить все файлы для конфигурации ':app:debugCompileClasspatAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Ошибка очистки пакета React-native ./gradlew. Не удалось разрешить все файлы для конфигурации ':app:debugCompileClasspat

Сообщение Anonymous »

Я пытаюсь добавить android.applicationVariants в build.gradle. но появляется ошибка: Не удалось разрешить все файлы для конфигурации ':app:debugCompileClasspath' - Несовпадающие атрибуты:

Код: Выделить всё

def extractFinFile(zip, variant, destFileName) {
copy {
from zip.matching { include 'guardit.fin' }
into "${buildDir}/outputs/fin/${variant.name}"
rename { filename ->
filename.replace 'guardit4j', "${destFileName}"
}
}
}

def extractFinFiles() {
android.applicationVariants.each { variant ->
if (android.hasProperty("dynamicFeatures")) {
def rootProjectName = project.rootProject.name
android.dynamicFeatures.each { String featureProjectName ->
def dynamicFeatureProject = project.rootProject.project(featureProjectName)
if (!dynamicFeatureProject.hasProperty("android")) {
// Android configuration is not accessible during project configuration
return
}

def applicationVariant = dynamicFeatureProject.android.applicationVariants.find { applicationVariant ->
applicationVariant.name == variant.name
}

if (!applicationVariant) {
return
}

def compileConfiguration = applicationVariant.compileConfiguration
compileConfiguration.resolvedConfiguration.firstLevelModuleDependencies.each { dependency ->
// This checks whether dependency is an application module itself
if (dependency.moduleGroup == rootProjectName && dependency.moduleName == project.name) {
return
}

dependency.moduleArtifacts.each { artifact ->
File dependencyFile = artifact.file
if (dependencyFile.name.endsWith(".aar")) {
def aarZip = zipTree(dependencyFile)
extractFinFile(aarZip, variant, dependencyFile.name.substring(0, dependencyFile.name.lastIndexOf('.')))
aarZip.files.each { fileFromAar ->
if (fileFromAar.name == "classes.jar") {
def classesJarZip = zipTree(fileFromAar)
extractFinFile(classesJarZip, variant, dependencyFile.name.substring(0, dependencyFile.name.lastIndexOf('.')))
}
}
} else if (dependencyFile.name.endsWith(".jar")) {
def jarZip = zipTree(dependencyFile)
extractFinFile(jarZip, variant, dependencyFile.name.substring(0, dependencyFile.name.lastIndexOf('.')))
}
}
}
}
}

def files = variant.compileConfiguration.files
files.each { file ->
println file.name
if (file.name.endsWith(".aar") ) {
def aarZip = zipTree(file)
extractFinFile(aarZip, variant, file.name.substring(0, file.name.lastIndexOf('.')))
aarZip.files.each { fileFromAar ->
if (fileFromAar.name == "classes.jar") {
def classesJarZip = zipTree(fileFromAar)
extractFinFile(classesJarZip, variant, file.name.substring(0, file.name.lastIndexOf('.')))
}
}
} else
if (file.name.endsWith(".jar")) {
def jarZip = zipTree(file)
extractFinFile(jarZip, variant, file.name.substring(0, file.name.lastIndexOf('.')))
}
}
}
}
Я получил ошибку при запуске команды ./gradlew clean Bundle

Код: Выделить всё

 > The consumer was configured to find a component for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'.  However we cannot choose between the following variants of project :react-native-firebase_messaging:
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-classes-jar declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Provides its elements packaged as a jar but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-lint declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-lint' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Provides its elements packaged as a jar but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-lint-local-aar declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-lint-local-aar' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-lint-model-metadata declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-lint-model-metadata' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-lint-variant-dependencies-model declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-lint-variant-dependencies-model' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-lint-variant-dependencies-partial-results declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1',  attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-lint-variant-dependencies-partial-results' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-manifest declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-manifest' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-renderscript declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-renderscript' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant android-symbol-with-package-name declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'android-symbol-with-package-name' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Configuration ':react-native-firebase_messaging:debugApiElements' variant jar declares a component for use during compile-time, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.1', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Doesn't say anything about its target Java environment (preferred optimized for Android)
- Provides attribute 'artifactType' with value 'jar' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
- Provides its elements packaged as a jar but the consumer didn't ask for it
я использую Gradle 8.7

Код: Выделить всё

distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
Java версии 17

Код: Выделить всё

java 17.0.10 2024-01-16 LTS
мне нужна помощь, чтобы решить эту проблему

Подробнее здесь: https://stackoverflow.com/questions/791 ... for-config
Реклама
Ответить Пред. темаСлед. тема

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

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

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

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

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

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