'react- native: 'adb' is not recognized as an internal or external command, operable program or batch file
Am new to react-native android app development. Please help me solve this issue.
Am not able to run my first application, am getting error as adb' is not recognized as an internal or external command, operable program or batch file.
I checked inside android sdk->platform-tools->i can see adb.exe there.
Build is successfull but getting error during run time. Below is my cmd prompt
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
E:\ReactWorkSpace\MyFirstApp>react-native run-android
Scanning 560 folders for symlinks in E:\ReactWorkSpace\MyFirstApp\node_modules (72ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportRecyclerviewV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:app:prepareComFacebookFrescoDrawee101Library
:app:prepareComFacebookFrescoFbcore101Library
:app:prepareComFacebookFrescoFresco101Library
:app:prepareComFacebookFrescoImagepipeline101Library
:app:prepareComFacebookFrescoImagepipelineBase101Library
:app:prepareComFacebookFrescoImagepipelineOkhttp3101Library
:app:prepareComFacebookReactReactNative0434Library
:app:prepareComFacebookSoloaderSoloader010Library
:app:prepareOrgWebkitAndroidJscR174650Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:transformClassesWithDexForDebug
Running dex in-process requires build tools 23.0.2.
For faster builds update this project to use the latest build tools.
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateSigningDebug
:app:packageDebug
:app:assembleDebug
:app:installDebug
Installing APK 'app-debug.apk' on 'A16 - 4.2.2' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL
Total time: 7 mins 4.412 secs
'adb' is not recognized as an internal or external command,
operable program or batch file.
Starting the app (D:\Android\sdk/platform-tools/adb shell am start -n com.myfirstapp/.MainActivity...
Starting: Intent { cmp=com.myfirstapp/.MainActivity }
E:\ReactWorkSpace\MyFirstApp>
Am not using emulator, am using my own mobile device. App is launched in my device but all i see is a white blank screen. I followed all the instructions properly as mentioned in the official website.
Thank you.
Solution 1:[1]
It is based upon your IDE, If you are using Webstorm you have to go to Settings -->Appearance & Behaviors --> Path Variable. Now you will get the new window that might have been empty. Top-Right of the you will see "+" icon you have to select that one and set your variable. My Variable is like:
Name: ANDROID_HOME Value: D:\Android_SDK\platform-tools.
Solution 2:[2]
You see blank screen because your server is not running or stopped
Did you run adb reverse if you are debugging using usb
try connecting laptop and mobile to same wifi and enter your ip:8081 in dev settings
Solution 3:[3]
I had this problem many times and the given answers are definetly the way to fix it but i recently got this error again but the build was successful and i couldn't fix it this way. i found out it was a internet connection error with the emulator.
just restart the emulator if you have this and make sure you can go on the internet opening google chrome.
Solution 4:[4]
If your metro is already stared but getting this error.Run Command this =====>. adb reverse tcp:8081 tcp:8081. App runs successfully on device.adb reverse tcp:8081 tcp:8081 If getting this kind of error:
Solution 5:[5]
I encounter this problem and even if you're doing the steps correctly it will not run unless you will do this solution.
For react-native-cli, if you are running the updated version you must install a "Java 11" and if you are running old react native then try installing the "Java 8".
(note that u will need to restart your system)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | HM Hamza Zubair |
| Solution 2 | Tom Marvolo Riddle |
| Solution 3 | Onur Balli |
| Solution 4 | Tomislav Stankovic |
| Solution 5 |

