Не удалось определить зависимости nullAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Не удалось определить зависимости null

Сообщение Anonymous »

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

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

PS C:\Users\Administrator\highMobileProgramming\MoneyBook> npx react-native run-android
(node:13480) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info A dev server is already running for this project on port 8081.
info Installing the app...

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of null.
> Could not resolve all dependencies for configuration 'classpath'.
> The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility

* 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

BUILD FAILED in 2s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of null. > Could not resolve all dependencies for configuration 'classpath'. > The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility * 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 BUILD FAILED in 2s.
info Run CLI with --verbose flag for more details.`
Я уже использовал React Native Doctor, и он говорит, что проблем и предупреждений нет.
введите здесь описание изображениякогда я спросил gpt в чате, мне сказали установить Java 21, поэтому я тоже попробовал это.
введите здесь описание изображения
и ./gradlew clean — нет работаю на меня.

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

PS C:\Users\Administrator\highMobileProgramming\MoneyBook\android> ./gradlew clean

`FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of null.
> Could not resolve all dependencies for configuration 'classpath'.
> The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility

* 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

BUILD FAILED in 1s

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

this is my build.gradle file.

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

buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
}
repositories {
google()
mavenCentral()
}
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.15")
}
}

allprojects {
repositories {
google()
mavenCentral()
}

}

android {
compileSdkVersion 35
defaultConfig {
minSdkVersion 24
targetSdkVersion 34
}

// sourceCompatibility 및 targetCompatibility 추가
compileOptions {
//sourceCompatibility JavaVersion.VERSION_21
//targetCompatibility JavaVersion.VERSION_21
}

// toolchain
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
}

//plugins {
//    id 'com.google.gms.google-services' version '4.3.15' apply false // firebase google-service
//}
//
//apply plugin: "com.facebook.react.rootproject"`

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

and this is my gradle-wrapper.properties file
distributionUrl=https://services.gradle.org/distributio ... .6-all.zip
Я понимаю, что это длинный. Если вы оставите комментарий, это мне очень поможет... Я работаю над этим уже три дня и не могу найти решение.
React Native Cli работает нормально без ошибок

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

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

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

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

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

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