1
votes

I am developing an android app using react native. When I run react-native run-android the build is successful but I get the following error:

C:\map\development\learnreact\react-native\helloworld>react-native run-android Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)...

Task :app:installDebug 03:46:26 V/ddms: execute: running am get-config 03:46:27 V/ddms: execute 'am get-config' on '988a5b324d47353950' : EOF hit. Read: -1 03:46:27 V/ddms: execute: returning Installing APK 'app-debug.apk' on 'SM-G955F - 8.0.0' for app:debug 03:46:27 D/app-debug.apk: Uploading app-debug.apk onto device '988a5b324d47353950' 03:46:27 D/Device: Uploading file onto device '988a5b324d47353950' 03:46:27 D/ddms: Reading file permision of C:\map\development\learnreact\react-native\helloworld\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------ 03:46:27 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk" 03:46:49 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '988a5b324d47353950' : EOF hit. Read: -1 03:46:49 V/ddms: execute: returning 03:46:49 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk" 03:46:49 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '988a5b324d47353950' : EOF hit. Read: -1 03:46:49 V/ddms: execute: returning Installed on 1 device.

BUILD SUCCESSFUL in 44s 28 actionable tasks: 1 executed, 27 up-to-date Running C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools/platform-tools/adb -s 988a5b324d47353950 reverse tcp:8081 tcp:8081 Could not run adb reverse: spawnSync C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools/platform-tools/adb ENOENT Starting the app on 988a5b324d47353950 (C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools/platform-tools/adb -s 988a5b324d47353950 shell am start -n com.helloworld/com.helloworld.MainActivity)...

I have checked the port as suggested on other question and that is not the source of the problem. Anyone know what the issue could be?

1

1 Answers

3
votes

I figured out a fix. Since it was giving an ENOENT error, I had to add a folder and name it "platform-tools" and adb.exe in it inside the C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools directory so that it becomes C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools\platform-tools\adb.exe and it worked.