Error failed to run jetifier

error Failed to run jetifier #32624 Comments Description I’m having problems trying to run an App from scratch error Failed to run jetifier I’ve installed everything on my Ubuntu 18.04 openjdk11, jre, etc. Android Studio Node, npm, yarn, react-native Downloaded Sdk, created AVD. I can run it manually, etc. Version Output of react-native info […]

Содержание

  1. error Failed to run jetifier #32624
  2. Comments
  3. Description
  4. Version
  5. Output of react-native info
  6. Steps to reproduce
  7. Snack, code example, screenshot, or link to a repository
  8. Failed to run jetifier React Native
  9. 12 Answers 12
  10. new project with RN 0.60.3 returns ENOENT #25667
  11. Comments
  12. Steps To Reproduce
  13. Describe what you expected to happen:
  14. Error:
  15. react-native run-android fails from terminal
  16. [HELP] Error : Failed to install the app. #28729
  17. Comments
  18. Description

error Failed to run jetifier #32624

Description

I’m having problems trying to run an App from scratch

error Failed to run jetifier

I’ve installed everything on my Ubuntu 18.04
openjdk11, jre, etc.
Android Studio
Node, npm, yarn, react-native
Downloaded Sdk, created AVD. I can run it manually, etc.

Version

Output of react-native info

warn Failed to run environment setup script «setup_env.sh»

Error: spawnSync /media/datos/html/reactnative/PruebaApp/node_modules/@react-native-community/cli/setup_env.sh EACCES
info React Native CLI will continue to run if your local environment matches what React Native expects. If it does fail, check out «/media/datos/html/reactnative/PruebaApp/node_modules/@react-native-community/cli/setup_env.sh» and adjust your environment to match it.
info Fetching system and libraries information.
(node:17659) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency
(Use node —trace-warnings . to show where the warning was created)
System:
OS: Linux 5.4 elementary OS 5.1.7 Hera
CPU: (6) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
Memory: 276.88 MB / 15.50 GB
Shell: 4.4.20 — /bin/bash
Binaries:
Node: 17.1.0 — /usr/bin/node
Yarn: 1.22.17 — /usr/bin/yarn
npm: 8.1.2 — /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: AI-203.7717.56.2031.7784292
Languages:
Java: 11.0.11 — /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.3 => 0.66.3
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. npx react-native init PruebaApp —template react-native-template-typescript
  2. cd PruebaApp
  3. npm i
  4. npx react-native run-android

Snack, code example, screenshot, or link to a repository

The text was updated successfully, but these errors were encountered:

Источник

Failed to run jetifier React Native

I tried to run react-native run-android and I got this error.

12 Answers 12

step 1: add these two lines in gradlew.properties Visit for complete guideline

step 2: use these commands

First of all remove node_modules folder and reinstall it using

every time when (your dependencies update or every time you install node_modules you have to jetify again)

When I was getting this error I noticed that I’m not in the main project folder I was inside the cd android folder. So I just cd .. it and it worked.

If you run npx react-native run-android in android folder. That error will happen. You need to run-android in the root directory.

react-native run-android —no-jetifier

I’m using yarn so I had to use

yarn react-native run-android —variant=release

Also to run in the simulator (not on a device) I had to install some extra stuff in Android Studio, see https://stackoverflow.com/a/64942777/3469524

react-native run-android —no-jetifier

and again start server

Mostly it happened by cache, metro server closed or already generated package in android folder. check jetifier is enabled in gradle.proporties

First close your metro server terminal window and run $ yarn android // this is almost solve your issue otherwise follow the below steps

$ cd android && ./gradlew clean

Clean the cache and build folders — generated & intermediates

Create the debug apk

$ ./gradlew AssembleDebug //output: Build successful

then check your apk output folder.

Run the react native package

$ yarn android || npx react-native run-android

Now it’s working fine.

The issue is in React Native CLI v2.6.1

Use Below steps to resolve the issue:

If you use lock files (yarn.lock or package-lock.json) — find the @react-native-community/cli entry, remove it, run yarn install / npm install once again.

If you don’t use lock files – remove node_modules and run yarn install / npm install again.

Run yarn list @react-native-community/cli or npm list @react-native-community/cli and verify you’re on the latest version (v2.6.2).

Источник

new project with RN 0.60.3 returns ENOENT #25667

Clean install with react-native init AwesomeApp results with ENONET error on react-native run-android

React Native version: 0.60.3
IDE: Visual Studio Code

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 2.47 GB / 7.95 GB
Binaries:
Node: 10.3.0 — C:Program Filesnodejsnode.EXE
npm: 6.1.0 — C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245

Steps To Reproduce

  1. run react-native init AwesomeApp
  2. run react-native run-android

Describe what you expected to happen:

Command to execute successfully.

Error:

error Failed to run jetifier. Error: spawnSync E:DEVAwesomeAppnode_modulesjetifierbinjetify ENOENT at Object.spawnSync (internal/child_process.js:981:20) at spawnSync (child_process.js:588:24) at execFileSync (child_process.js:616:13) at Object.runAndroid [as func] (E:DEVAwesomeAppnode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidindex.js:101:41) at Command.handleAction (E:DEVAwesomeAppnode_modulesreact-nativenode_modules@react-native-communityclibuildcliEntry.js:160:21) at Command.listener (E:DEVAwesomeAppnode_modulescommanderindex.js:315:8) at Command.emit (events.js:182:13) at Command.parseArgs (E:DEVAwesomeAppnode_modulescommanderindex.js:651:12) at Command.parse (E:DEVAwesomeAppnode_modulescommanderindex.js:474:21) at setupAndRun (E:DEVAwesomeAppnode_modulesreact-nativenode_modules@react-native-communityclibuildcliEntry.js:210:24)

The text was updated successfully, but these errors were encountered:

Источник

react-native run-android fails from terminal

D:ReactNativeAwesomeProject>react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag. Jetifier found 863 file(s) to forward-jetify. Using 4 workers. info Starting JS server. info Launching emulator. error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds . warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app. :ReactNative:Cannot run program «npx»: CreateProcess error=2, The system cannot find the file specified :ReactNative:Automatic import of native modules failed.

FAILURE: Build failed with an exception.

Where: Script ‘D:ReactNativeAwesomeProjectnode_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 169

What went wrong: A problem occurred evaluating script.

Cannot invoke method getErrorStream() on null object

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.

BUILD FAILED in 1s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with —verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

Where: Script ‘D:ReactNativeAwesomeProjectnode_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 169

What went wrong: A problem occurred evaluating script.

Cannot invoke method getErrorStream() on null object

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.

Источник

[HELP] Error : Failed to install the app. #28729

When I send «react-native run-android», I have an error

Description

info Running jetifier to migrate libraries to AndroidX. You can disable it using «—no-jetifier» flag.
Jetifier found 1067 file(s) to forward-jetify. Using 4 workers.
info JS server already running.
info Installing the app.

FAILURE: Build failed with an exception.

Where:
Script ‘C:UsersL�oDocumentsReactNativeMoviesAndMenode_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 195

What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:983 throw err; ^Error: Cannot find module ‘C:UsersLéoDocumentsReactNativeMoviesAndMenode_modulesreact-nativenode_modules@react-native-communityclibuildbin.js’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47

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.

BUILD FAILED in 1s

FAILURE: Build failed with an exception.

Where:
Script ‘C:UsersL�oDocumentsReactNativeMoviesAndMenode_modules@react-native-communitycli-platform-androidnative_modules.gradle’ line: 195

What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:983 throw err; ^Error: Cannot find module ‘C:UsersLéoDocumentsReactNativeMoviesAndMenode_modulesreact-nativenode_modules@react-native-communityclibuildbin.js’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) at Function.Module._load (internal/modules/cjs/loader.js:862:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47

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.

BUILD FAILED in 1s

If someone had the same issue and found a solution, please help me. Thank you

The text was updated successfully, but these errors were encountered:

Источник

Clean install with react-native init AwesomeApp results with ENONET error on react-native run-android

React Native version: 0.60.3
IDE: Visual Studio Code

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 2.47 GB / 7.95 GB
Binaries:
Node: 10.3.0 — C:Program Filesnodejsnode.EXE
npm: 6.1.0 — C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245

Steps To Reproduce

  1. run react-native init AwesomeApp
  2. run react-native run-android

Describe what you expected to happen:

Command to execute successfully.

Error:

error Failed to run jetifier. Error: spawnSync E:DEVAwesomeAppnode_modulesjetifierbinjetify ENOENT at Object.spawnSync (internal/child_process.js:981:20) at spawnSync (child_process.js:588:24) at execFileSync (child_process.js:616:13) at Object.runAndroid [as func] (E:DEVAwesomeAppnode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidindex.js:101:41) at Command.handleAction (E:DEVAwesomeAppnode_modulesreact-nativenode_modules@react-native-communityclibuildcliEntry.js:160:21) at Command.listener (E:DEVAwesomeAppnode_modulescommanderindex.js:315:8) at Command.emit (events.js:182:13) at Command.parseArgs (E:DEVAwesomeAppnode_modulescommanderindex.js:651:12) at Command.parse (E:DEVAwesomeAppnode_modulescommanderindex.js:474:21) at setupAndRun (E:DEVAwesomeAppnode_modulesreact-nativenode_modules@react-native-communityclibuildcliEntry.js:210:24)

#javascript #android #react-native #gradle #android-jetifier

Вопрос:

Понятия не имею, что происходит или что мне нужно исправить. Я пишу предложения, чтобы я мог публиковать. Понятия не имею, что происходит или что мне нужно исправить. Я пишу предложения, чтобы я мог публиковать. Понятия не имею, что происходит или что мне нужно исправить. Я пишу предложения, чтобы я мог публиковать.

Терминал

 info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
    error Failed to run jetifier.
    Error: Cannot find module 'which'
    Require stack:
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesexecanode_modulescross-spawnlibutilresolveCommand.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesexecanode_modulescross-spawnlibparse.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesexecanode_modulescross-spawnindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesexecaindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communitycli-platform-androidbuildcommandsindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communitycli-platform-androidbuildindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesreact-nativereact-native.config.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulescosmiconfignode_modulesimport-freshindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulescosmiconfigdistloaders.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulescosmiconfigdistcreateExplorer.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulescosmiconfigdistindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildtoolsconfigreadConfigFromDisk.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildtoolsconfigindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildcommandsinstallinstall.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildcommandsindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildindex.js
    - C:UserskcopuDesktopReactNativeProjectsUberClonenode_modules@react-native-communityclibuildbin.js
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
        at Function.Module._load (node:internal/modules/cjs/loader:772:27)
        at Module.require (node:internal/modules/cjs/loader:999:19)
        at require (node:internal/modules/cjs/helpers:93:18)
        at Object.<anonymous> (C:UserskcopuDesktopReactNativeProjectsUberClonenode_modulesexecanode_modulescross-spawnlibutilresolveCommand.js:4:15)
        at Module._compile (node:internal/modules/cjs/loader:1095:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
        at Module.load (node:internal/modules/cjs/loader:975:32)
        at Function.Module._load (node:internal/modules/cjs/loader:816:12)
        at Module.require (node:internal/modules/cjs/loader:999:19)
    info Run CLI with --verbose flag for more details.
 

Description

I’m having problems trying to run an App from scratch

error Failed to run jetifier

I’ve installed everything on my Ubuntu 18.04
openjdk11, jre, etc.
Android Studio
Node, npm, yarn, react-native
Downloaded Sdk, created AVD. I can run it manually, etc.

Version

0.66.3

Output of react-native info

warn Failed to run environment setup script «setup_env.sh»

Error: spawnSync /media/datos/html/reactnative/PruebaApp/node_modules/@react-native-community/cli/setup_env.sh EACCES
info React Native CLI will continue to run if your local environment matches what React Native expects. If it does fail, check out «/media/datos/html/reactnative/PruebaApp/node_modules/@react-native-community/cli/setup_env.sh» and adjust your environment to match it.
info Fetching system and libraries information…
(node:17659) Warning: Accessing non-existent property ‘padLevels’ of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
System:
OS: Linux 5.4 elementary OS 5.1.7 Hera
CPU: (6) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
Memory: 276.88 MB / 15.50 GB
Shell: 4.4.20 — /bin/bash
Binaries:
Node: 17.1.0 — /usr/bin/node
Yarn: 1.22.17 — /usr/bin/yarn
npm: 8.1.2 — /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: AI-203.7717.56.2031.7784292
Languages:
Java: 11.0.11 — /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.3 => 0.66.3
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. npx react-native init PruebaApp —template react-native-template-typescript
  2. cd PruebaApp
  3. npm i
  4. npx react-native run-android

Snack, code example, screenshot, or link to a repository

imagen_0023

In native mobile development, we use two different languages Java or Kotlin for Android and Swift/objective-c for iOS.  To reduce the development time and complexity of different languages Facebook Launched ReactNative. ReactNative enables app developers to develop a single application for both the Android & iOS platforms. ReactNative uses Javascript language which makes app development tasks easy, efficient, powerful ways to develop mobile applications.

In this blog, I will explain the setup up of React Native Application for Windows. I have faced many issues on the setup for the same and at last I succeeded. I have followed the Facebook react native document for the setup

They provide us with two methods for creating the application, the first one is Expo CLI Quickstart, and the second by React-Native CLI Quickstart. In this blog, I will tell you about the React Native CLI.

There are two methods for installing the dependencies ( Node and Python2 ,JDK) ,first is using the Chocolatey, a popular package manager for Windows,second is installing the dependencies individually and then set the required path of the Environment variable but Chocolatey will help us in setting the Environment variable for us. The following steps will help you with the installation process.

Steps 1. Install Chocolatey

You can install this from the Windows PowerShell ,make it administrative then hit enter and then run the following command :

That’s it ,to ensure type choco or choco -? and hit enter

Steps 2. Installing dependencies

Open an Administrator Command Prompt (right click Command Prompt and select «Run as Administrator»), then run the following command:

choco install –y nodejs.install python2 openjdk8

Before proceeding to the next step make sure that the path for each dependency is added, you can check the path details from the Troubleshooting steps given below .

Steps 3. Install Android Studio

Installed the latest version and configure the ANDROID_HOME environment variable for SDK and platform tools from the Windows Control Panel, SDK Tools, Platform tools you can take the help from the below screenshots.

Once the Android Studio is installed into your system then click on the configuration and select the SDK Manager and then installed the below SDK Tools and Platform Tools .

Now its time to configure the path from the system environment variables.To do so follow these below steps:

  1. Open the Windows Control Panel.
  2. Click on User Accounts, then click User Accounts again
  3. Click on Change my environment variables
  4. Click on New… to create a new ANDROID_HOME user variable that points to the path to your Android SDK:

Add platform-tools to Path

  1. Open the Windows Control Panel.
  2. Click on User Accounts, then click User Accounts again
  3. Click on Change my environment variables
  4. Select the Path variable.
  5. Click Edit.
  6. Click New and add the path to platform-tools to the list

Steps 4. React Native Command Line Interface

In this step install the CLI globally using the following command —

npm install –g react-native-cli

Steps 5.  Initiate the project

To create the project  run the following command-

npx react-native init FirstProject

Steps 5.  Run the project

Now all the setup is done it’s time to run our first React Native App using the following Command that should be passed through your Visual studio Code (Editor or IDE you can use any other as well) terminal. Prior to that, open the Android studio then select the Existing project, and then add the android folder from your project directory (make sure that you don’t have to include the whole project as the android studio works on the JAVA Language and React Native uses the JAVASCRIPT so we can’t edit our code from here )

npx react-native run-android

Also Read: React Native Tutorial Using Redux

If you find any difficulties while the installation process you can go through the below Troubleshooting steps .

Troubleshooting Steps –

After doing so much of stuff when I run my application I was encountered with an error that – 

Error- packages .ps1 cannot be loaded because running scripts is disabled on this system

So if you ever get this error ,simply you can follow these steps to solve the issue —

Step-1 Open Windows Powershell with Run As Administrator.

Step-2 — Use this command on Windows Powershell to get it.

Get-ExecutionPolicy

Step-3 Now we need to change this policy to allow the operation. Use this command to make it Unrestricted –

Set-ExecutionPolicy Unrestricted 

That’s it. To confirm you may check the execution policy status by this command again.

Get-ExecutionPolicy

Error: Failed to install the app. Ensure that you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with —verbose flag for more details.

For which I had followed some steps which will help you a lot with the same issue –

First Check whether your emulator is running or plugging device is plugged properly or not , If not then Fix them then run the application .You can also check the whether device is connected or not using the ADB command and it will return you the list of adb devices .

adb devices

other ADB commands that are mostly used are –

adb kill-server

adb start-server

If the above step will not help you then check whether all the dependencies path are giving properly or not from the environment variable, If the path is not correct then fix them and run the application.

To check the dependencies path

  • Open the Windows Control Panel.
  • Click on User Accounts, then click User Accounts again
  • Click on Change my environment variables

If above these steps will not help you then be patient take a long breath and follow the below steps :

Run react-native info and it will return the List of all packages included in your project and what is missing so edit your issue to include these results under the Environment section.

As you can see, in my case NDK was not found, and also the React-Native –CLI was not globally found so for that I go to the Android Studio and then from the SDK platform tools I had installed the NDK, and then I had Run the Command npm install –g react-native-cli to install the CLI interface globally this solution helps me in resolving the issue.

Error : Failed to install the app. Please confirm you have the Android development environment set up by clicking on this link: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Running 'npx --quiet --no-install react-native config' command from 'null' directory failed.

To solve this issue first I clean the gradle from the project directory using the below Commands 

Cd android, then run gradlew clean
after clean gradle the run cd.. and run npx react-native run-android

Error : Failed to run jetifier React Native

To solve this issue you have to use  the below command and it removes the errors from my project

react-native run-android —no-jetifier

Error: Unable to locate adb

To solve this issue you have to open Studio settings—>System settings —> Android SDK —> select SDK tool tab —>> select «Android SDK platform tool» and install

Official Link:

https://reactnative.dev/docs/environment-setup

We are a SaaS application development company that provides end-to-end mobile app development services with a focus on cutting-edge technologies. Our development team uses JavaScript tools like Angular, Node, and ReactJS to make it adaptable, responsive, and include rich web applications to address different business prerequisites. We have an experienced team of Full Stack engineers that are skilled at performing both frontend and backend assignments. Our SaaS app development services address your project requirements by developing user-friendly apps that are easy to scale.

Issue

I am new to react native, I was trying to follow an example on how to launch react native app with react native CLI but I keep getting this error in my CMD.

C:React Native WorkspaceRN-CLIFirstCli>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
'adb' is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:React Native WorkspaceRN-CLIFirstCliandroidlocal.properties'.

* 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 10s

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.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:React Native WorkspaceRN-CLIFirstCliandroidlocal.properties'.

* 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 10s

    at makeError (C:React Native WorkspaceRN-CLIFirstClinode_modulesexecaindex.js:174:9)
    at C:React Native WorkspaceRN-CLIFirstClinode_modulesexecaindex.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:React Native WorkspaceRN-CLIFirstClinode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:109:5)
    at async Command.handleAction (C:React Native WorkspaceRN-CLIFirstClinode_modules@react-native-communityclibuildindex.js:192:9)
info Run CLI with --verbose flag for more details.

I need help with resolving these issues.

Solution

Assuming that you already have the Android SDK installed, you need to create a file named local.properties at the root of you Android project your-react-native-project-android/ and you should also add it to .gitignore if you are using git.

The file must indicate the path of the SDK on your computer, for macOS for example

local.properties

## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Tue Oct 26 14:02:40 CEST 2021
sdk.dir=/Users/username/Library/Android/sdk

If you never installed the SDK, you need to start here

Answered By — yemd

Понравилась статья? Поделить с друзьями:
  • Error failed to request appinfo update not online or not logged in to steam перевод
  • Error failed to read the downloaded file gmod
  • Error failed to read install path error 234 skyrim что делать
  • Error failed to push some refs to что это
  • Error failed to push some refs to перевод