Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Losing connection to device during start with Android studio

I'm having problems with setting up my Mobile phone (Samsung Galaxy J5) to work as my Test-Device for flutter in android studio. I in-between managed to start my app on my phone but always lost connection after a while. Today it won't start up at all without any changes in the settings. The output in the console of android studio looks as follows

Launching lib/main.dart on SM J510FN in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk.
error: device '933fecf1' not found
Installing build/app/outputs/apk/app.apk...
Error: ADB exited with exit code 255
adb: error: failed to get feature set: device '933fecf1' not found

error: device '933fecf1' not found
- waiting for device -
Error launching application on SM J510FN.

I've seen the android studio losing connection to my phone while trying to install the app.apk. As the connection hasn't been steady at any point since I started getting in touch with flutter and android studio I guess there might be an issue with the adb but I have no clue how to track it down.

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14.2 18C54, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] Connected device (1 available)

• No issues found!
like image 267
Martin Avatar asked Jan 24 '19 13:01

Martin


2 Answers

I was able to find the solution for my problem and want to share nevertheless it seems it a little too simple: I was using a defect USB cable. Changing to a newer cable solved all connection problems immediately.. Thanks for the help anyway!

like image 188
Martin Avatar answered Nov 07 '22 17:11

Martin


For me it was solved as I disabled "Use libusb backend" for "Android Debug Bridge (adb) in the settings: screenshot

like image 25
Ivan Pavlov Avatar answered Nov 07 '22 16:11

Ivan Pavlov