Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npx react-native run-android: E/Device: Error during Sync: EOF

I am trying to run react native app to my real android device. I checked my device before running

adb devices

List of devices attached
3357425441473098        device

I started with

npx react-native start

and in other console

npx react-native run-android

But got an error..

Task :app:installDebug FAILED                                                                                                                                                     
10:25:40 V/ddms: execute: running am get-config                                                                                                                                     
10:25:40 V/ddms: execute 'am get-config' on '3357425441473098' : EOF hit. Read: -1                                                                                                  
10:25:40 V/ddms: execute: returning                                                                                                                                                 
Installing APK 'app-debug.apk' on 'SM-G960U - 9' for app:debug                                                                                                                      
10:25:40 D/app-debug.apk: Uploading app-debug.apk onto device '3357425441473098'                                                                                                    
10:25:40 D/Device: Uploading file onto device '3357425441473098'                                                                                                                    
10:25:40 D/ddms: Reading file permision of /home/user/react-native/awesomeProject/android/app/build/outputs/apk/debug/app-debug.apk as: rw-rw-r--                
10:25:40 D/ddms: read: channel EOF                                                                                                                                                  
10:25:40 E/Device: Error during Sync: EOF                                                                                                                                           
Unable to install /home/user/react-native/awesomeProject/android/app/build/outputs/apk/debug/app-debug.apk                           
com.android.ddmlib.InstallException: EOF      

And right after that error. I lost my device connection.

adb devices

shows nothing..

and at the bottom of stacktrace I see this error also

Caused by: java.io.IOException: EOF
        at com.android.ddmlib.AdbHelper.read(AdbHelper.java:862)
        at com.android.ddmlib.SyncService.doPushFile(SyncService.java:712)
        at com.android.ddmlib.SyncService.pushFile(SyncService.java:406)
        at com.android.ddmlib.Device.syncPackageToDevice(Device.java:988)
        at com.android.ddmlib.Device.installPackage(Device.java:902)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: EOF

* 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 checkExecSyncError (child_process.js:629:11)
    at execFileSync (child_process.js:647:13)
    at runOnAllDevices (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevice
s.js:94:39)
    at buildAndRun (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at then.result (/home/user/react-native/newProject/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)

My device is us samsumg galaxy s9. It was working when I use Expo sdk. What is my problem?

react-native : 0.61.5

Weird thing is that it works first execution after computer boot. then I tried reconnect phone, and it pops up again.

like image 278
freewebwithme Avatar asked Jul 14 '26 03:07

freewebwithme


2 Answers

I had a similar issue. I noticed that the USB configuration defaults back to No data transfer every time I connect it with an USB-cable. It even seems to happen sometimes when the cable is still connected.

You can change the default USB configuration in the developer settings:

Go to Developer Options > Default USB configuration > and change the setting to File Transfer / Android auto

like image 77
Wirling Avatar answered Jul 25 '26 16:07

Wirling


Just had the same problem. Turned out it was an issue with my USB cable. For some reason the installation process was being interrupted half way through by the device going offline. I've replaced the cable, and everything started working again.

like image 22
jlblca9l_kpblca Avatar answered Jul 25 '26 17:07

jlblca9l_kpblca



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!