redwhale21
redwhale21

Reputation: 37

React Native won't run in Android device

I just started to learn React Native. I was trying to run my react-native-cli apps to my phone it already install to my phone but it won't run. Here's the details:

  1. I'm using Xiaomi Redmi 4x
  2. USB Debugging on
  3. Install via USB on
  4. USB Debugging(Security Setting) on
  5. Verify apps over USB on
  6. Turn on MIUI optimization has been disabled

When I execute react-native run-android it run well, and the app is installed in my device but the app won't run in my device and I got this error in terminal

BUILD SUCCESSFUL in 54s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
debug Running command "C:\Users\Handa-Kun\AppData\Local\Android\Sdk;C:\Users\Handa-Kun\AppData\Local\Android\Sdk\platform-tools;/platform-tools/adb reverse tcp:8081 tcp:8081"
warn Failed to connect to development server using "adb reverse": spawnSync C:\Users\Handa-Kun\AppData\Local\Android\Sdk;C:\Users\Handa-Kun\AppData\Local\Android\Sdk\platform-tools;/platform-tools/adb ENOENT
info Starting the app...
debug Running command "C:\Users\Handa-Kun\AppData\Local\Android\Sdk;C:\Users\Handa-Kun\AppData\Local\Android\Sdk\platform-tools;/platform-tools/adb shell
am start -n com.appkedua/com.appkedua.MainActivity"
The filename, directory name, or volume label syntax is incorrect.
error Failed to start the app.
Error: Command failed: C:\Users\Handa-Kun\AppData\Local\Android\Sdk;C:\Users\Handa-Kun\AppData\Local\Android\Sdk\platform-tools;/platform-tools/adb shell
am start -n com.appkedua/com.appkedua.MainActivity
    at makeError (F:\react-native\AppKedua\node_modules\execa\index.js:174:9)

I've been lurking in Stack Overflow and Google but I couldn't find the answer.

Upvotes: 1

Views: 656

Answers (1)

moxspoy
moxspoy

Reputation: 830

it seems problem with your ANDROID HOME path, you can try this

execute following commmand

set ANDROID_HOME=c:/Users/whoever/AppData/Local/Android/Sdk

for detail explanation please go to React Native adb reverse ENOENT

Upvotes: 2

Related Questions