Код: Выделить всё
PS C:\workspace\projects\Streaker> npm run android
> [email protected] 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.
Код: Выделить всё
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')
Код: Выделить всё
// 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
Подробнее здесь: https://stackoverflow.com/questions/793 ... y-cli-plat