React Native – ОШИБКА: сборка не удалась с исключениемAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 React Native – ОШИБКА: сборка не удалась с исключением

Сообщение Anonymous »

Я постоянно получаю следующую ошибку при попытке создать собственное приложение реагирования. Я попытался вручную установить различные версии версии плагина Android Gradle и совместимые версии Gradle, но безрезультатно. Однако это просто меняет версию Gradle в ошибке. Кажется, что проект собирается, когда я пытаюсь перезагрузить его, нажимая "r".

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

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'TestDeleteMe'.
> Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:8.4.0.
Required by:
project :
> No matching variant of com.android.tools.build:gradle:8.4.0 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.6' but:
- Variant 'apiElements' capability com.android.tools.build:gradle:8.4.0 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'javadocElements' capability com.android.tools.build:gradle:8.4.0 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'runtimeElements' capability com.android.tools.build:gradle:8.4.0 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'sourcesElements' capability com.android.tools.build:gradle:8.4.0 declares a component for use during runtime, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
> Could not resolve com.facebook.react:react-native-gradle-plugin.
Required by:
project :
> No matching variant of project :gradle-plugin was found.  The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.6' but:
- Variant 'apiElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'mainSourceElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Doesn't say anything about its usage (required runtime)
- Variant 'runtimeElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Variant 'testResultsElementsForTest' capability com.facebook.react:react-native-gradle-plugin:unspecified:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.6')
- Doesn't say anything about its usage (required runtime)
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
Required by:
project :
Запуская npx React-native Doctor, я получаю следующее:

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

Common
✓ Node.js - Required to execute JavaScript code
✓ npm - Required to install NPM dependencies
✓ Metro - Required for bundling the JavaScript code

Android
✓ Adb - Required to verify if the android device is attached correctly
✖ JDK - Required to compile Java code
- Version found: N/A
- Version supported: >= 17 

Подробнее здесь: [url]https://stackoverflow.com/questions/78462717/react-native-failure-build-failed-with-an-exception[/url]
Ответить

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

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

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

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

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