How to solve "Waiting for a connection from Flutter on device..."

Viewed 5507

When I run the default test app on my devices all the console outputs is

Waiting for a connection from Flutter on SM N950F...

I thought the problem could be my physical device but I realized this isn't the case I tested it on two emulators and I get the same output.

When I run flutter doctor -v my output is:

[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18362.959], locale en-ZA)
• Flutter version 1.17.5 at C:\src\flutter\flutter
• Framework revision 8af6b2f038 (3 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4


[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\Jimmy\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] Connected device (1 available)
    • SM N950F • _myDeviceID_ • android-arm64 • Android 9 (API 28)

• No issues found!
1 Answers

Ok, so I've managed to figure something out.- I'll be answering my own question:

My current version of Android Studio (version 4.0.1) just doesn't want to run an app straight from the UI so you kinda have to brute force it from the terminal.

  1. Make sure that your API level you're running your device on is the same as what you have installed on Android Studio.

1.1 Click on the SDK Manager button around the top right corner of AS (The icon is a box with a down arrow next to it)

enter image description here

1.2 Choose the same API level as your device, (When I didn't do this I had a partial install and it took some time to compile), then click apply and wait for it to install. enter image description here

  1. We're going to run the project to our avd or mobile device from the directory of ourproject.

2.1 Open up the Command Prompt (preferably as Admin), and chage the directoy to where your project is, the command should look something like this

cd Documents\AndroidStudioProjects\your_flutter_app_folder

2.2 Finally type the command flutter run it will take about 1 minute to compile, first time round.

Related