cilphex
cilphex

Reputation: 6096

Flutter - Dartlang: Run Application command fails

When using Atom with the dartlang package, I attempt to use the Dartlang: Run Application command and get the following result:

[/Users/craig/Code/flutter-test/atom1] pub run flutter start
Unable to run on Android.
Unable to run on Android.
Unable to run application - no connected devices.

I get the same thing in the console when running flutter start in the app directory.

My phone is a Nexus 6p that is connected to my computer via USB and has 'USB debugging' enabled in Developer options. How can I get these commands to successfully deploy the app to my device?

Upvotes: 1

Views: 485

Answers (2)

Mark Anthony
Mark Anthony

Reputation: 134

open the device in avd manager and try to run the command again or you can use your own mobile device just plug your device to your laptop or computer in android you have to enable USB debugging in developer mode setting

or you can build a apk and install it on your device

flutter build

Upvotes: 0

cilphex
cilphex

Reputation: 6096

Though my device was connected, it was not "authorized". I used the adb devices command to check if it was connected, and the output was something like this:

02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972    unauthorized

Note the unauthorized on the last line. After some googling, I learned to go into my phone, and toggle Developer Options > USB debugging from enabled, to disabled, to enabled again. I did this without disconnecting the phone. Re-running adb devices then showed:

02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972    device

Note device on the last line instead of unauthorized. I re-ran the Dartlang: Run Application from within Atom and the deploy worked. Somewhere in there, I had to accept the push to device from my phone.

Upvotes: 3

Related Questions