PS C:\workspace\projects\Streaker> npm run android
> streaker@0.0.1 android
> react-native run-android
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.
* Where:
Settings file 'C:\workspace\projects\Streaker\android\settings.gradle' line: 2
* What went wrong:
A problem occurred evaluating settings 'streaker'.
> Could not read script 'C:\workspace\projects\Streaker\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
* 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
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Settings file 'C:\workspace\projects\Streaker\android\settings.gradle' line: 2 * What went wrong: A problem occurred evaluating settings 'streaker'. > Could not read script 'C:\workspace\projects\Streaker\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist. * 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.
info Run CLI with --verbose flag for more details.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
Я пробовал:
Удалить модули узла и переустановить
Запустите ./gradlew clean внутри /android
Сопоставление версий React Native и @react-native-community/cli-platform-android с версией 15.1.2
У меня есть нативный проект, над которым я не работал уже 2 месяца, теперь, когда я пытаюсь его запустить, я получаю следующие ошибки: [code]PS C:\workspace\projects\Streaker> npm run android
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
* What went wrong: A problem occurred evaluating settings 'streaker'. > Could not read script 'C:\workspace\projects\Streaker\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
* 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 error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Settings file 'C:\workspace\projects\Streaker\android\settings.gradle' line: 2 * What went wrong: A problem occurred evaluating settings 'streaker'. > Could not read script 'C:\workspace\projects\Streaker\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist. * 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. info Run CLI with --verbose flag for more details. [/code] это мой android/settings.gradle: [code]rootProject.name = 'streaker' 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') [/code] а это мой android/build.gradle: [code]// Top-level build file where you can add configuration options common to all sub-projects/modules.
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") } } [/code] Я пробовал: [list] [*]Удалить модули узла и переустановить [*] Запустите ./gradlew clean внутри /android [*]Сопоставление версий React Native и @react-native-community/cli-platform-android с версией 15.1.2[/list] Будем благодарны за любую помощь.