Issue
This is my first react native setup. I started to build with react-native run android
and got BUILD SUCCESSFUL in 4m 7s
message.
Then the CLI script tried:
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
'adb' is not recognized as an internal or external command,
operable program or batch file.
error Failed to start the app.
Error: Command failed: adb shell am start -n com.notez/com.notez.MainActivity
at makeError (S:\Projects (my)\notez\node_modules\execa\index.js:174:9)
at Function.module.exports.sync (S:\Projects (my)\notez\node_modules\execa\index.js:338:15)
But I had settled everything up. ADB and SDK paths are defined in my OS ENV config.
So I tried to execute the failed code above on another console:
adb shell am start -n com.notez/com.notez.MainActivity
Then it worked! How can I define the 'adb' as an internal or external command as the error refers?
Solution
I changed the enviroment variable ANDROID_HOME
value from C:\Users\User\AppData\Local\Android\Sdk\
to C:\Users\User\AppData\Local\Android\Sdk\platform-tools\
and it worked...
Answered By - M. Emre Yalçın
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.