Обновление Java привело к тому, что я не смог скомпилировать/запустить проект React Native в Android.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Обновление Java привело к тому, что я не смог скомпилировать/запустить проект React Native в Android.

Сообщение Anonymous »

Вчера я получил уведомление об обновлении JAVA и обновил его. Вчера я не занимался разработкой React Native, но сегодня мне нужно было провести небольшое тестирование приложения, и я заметил, что не могу его запустить.
Когда я запускаю эту команду : npx response-native run-android
Я получаю сообщение об ошибке со следующим сообщением:

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

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'FlotasnetMobile2'.
> Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:.
Required by:
project :
> 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.3' 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.3')
- 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.3')
- 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.3')
- 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.3')
- Doesn't say anything about its usage (required runtime)
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
Required by:
project :

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Похоже, это связано с плагином Gradle. Я разместил соответствующую информацию:
JAVA версии 8, обновление 421 (сборка 1.8.0_421-b09)
Версия React: "18.2.0".
Версия React Native: "0.73.8".
В

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

setting.gradle
[/b] файл:

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

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
В

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

build.gradle
[/b] файл:

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

dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath("com.google.gms:google-services:4.3.3")
}
В

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

app/build.gradle
[/b] файл:

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

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
Я пробовал запустить npm i response-native-gradle-plugin, но не помогло.

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

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

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

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

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

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