Home > Enterprise >  react-native run-android gives err FAILURE:Build failed Where: Build file 'C:\...\node_module
react-native run-android gives err FAILURE:Build failed Where: Build file 'C:\...\node_module

Time:06-09

i am new to react-native cli any time i run npm run android in my react-native project after opening the emulator and js server

while it throws an error saying

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11

in full

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11

* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
  Searched in the following repositories:
    MavenRepo
    Google
    Gradle Central Plugin Repository

* 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 11m 1s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\HP\Desktop\native1\node_modules\react-native-gradle-plugin\build.gradle.kts' line: 11

* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (None of the included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10')
  Searched in the following repositories:
    MavenRepo
    Google
    Gradle Central Plugin Repository

* 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 11m 1s

    at makeError (C:\Users\HP\Desktop\native1\node_modules\execa\index.js:174:9)
    at C:\Users\HP\Desktop\native1\node_modules\execa\index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (C:\Users\HP\Desktop\native1\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (C:\Users\HP\Desktop\native1\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2022-06-01T14_25_45_278Z-debug.log

any sugestion will be highly appreciated

CodePudding user response:

This part is the interesting:

Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.10'] was not found in any of the following sources:

The same question here.

CodePudding user response:

In your project gradle file,

change org.jetbrains.kotlin.jvm to org.jetbrains.kotlin.android

Maybe this will help. Basically, gradle could not find the kotlin plugin dependency in any of the sources.

  • Related