4

I read StackOverflow questions including the following ones:

BUT, I couldn't solve my issue....... :-(


My Flutter folder structure

  • D:\src\flutter

  • D:\src\sdk

My Project folder location : D:\__GitHub


Flutter SDK Setup Steps

  • Add the following User environment variable

    • Variable Name : ANDROID_SDK_ROOT

    • Variable Value : D:\src\sdk

  • Edit the "PATH" variable in the User enviroment variable

    • D:\src\flutter\bin;

    • %ANDROID_SDK_ROOT%\tools;

    • %ANDROID_SDK_ROOT%\platform-tools;

  • Run flutter config --android-sdk [sdk location] in the terminal

  • Run flutter doctor --android-licenses in the terminal


Launch an AVD in the emulator

  • D:\__GitHub\netninja_flutter_app > flutter doctor --android-licenses

    • All SDK package licenses accepted
  • D:\__GitHub\netninja_flutter_app > flutter emulator

    • Pixel_2_API_28
  • D:\__GitHub\netninja_flutter_app > flutter emulator --launch Pixel_2_API_28

    • enter image description here

enter image description here

  • When clicked, "Nothing here" shows up.

enter image description here

  • When clicked, the following message pops up.

    enter image description here

enter image description here

  • When clicked, the following window shows up.

    enter image description here

    • I added a virtual device.

Flutter Doctor

  • D:\__GitHub\netninja_flutter_app > flutter doctor -v

    • [✓] Flutter (Channel stable, 1.22.2, on Microsoft Windows [Version 6.1.7601], locale en-US)

      • [✓] Flutter version 1.22.2 at D:\src\flutter

      • [✓] Framework revision 84f3d28555 (9 days ago), 2020-10-15 16:26:19 -0700

      • [✓] Engine revision b8752bbfff

      • [✓] Dart version 2.10.2

    • [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.)

      • [✓] Android SDK at D:\src\sdk

      • [✓] Platform android-30, build-tools 30.0.2

      • [✓] ANDROID_SDK_ROOT = D:\src\sdk

      • [✓] Java binary at: D:_programs\Android\jre\bin\java

      • [✓] Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

      • [✓] All Android licenses accepted

    • [✓] Android Studio (version 4.1.0)

      • [!] Flutter plugin not installed; this adds Flutter specific functionality

      • [!] Dart plugin not installed; this adds Dart specific functionality

      • [✓] Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

=> I installed "Dart" & "Flutter" plugins. So, I don't know why the error message says that those plugins are not installed. (This answer says just ignore the error message. So, I did so.) enter image description here


QUESTION! How could I connect a device to this project?


Lim
  • 753
  • 14
  • 31
  • I have encountered a similar problem,.In my case, I had to enable developer mode in the emulator, and after I could connect it to the project. – Tamir Abutbul Oct 25 '20 at 09:09
  • Did you activate the developer mode on your smartphone? – Ostap Filipenko Oct 25 '20 at 09:19
  • Try invalidate cache & restart your Android Studio – 333 Oct 25 '20 at 09:20
  • @TamirAbutbul After reading your comment, I enabled the developer mode in the emulator. But, I still can't link my project to the emulator... :( – Lim Oct 25 '20 at 10:15
  • @ProKemikon Yes, but it's still not working... :( – Lim Oct 25 '20 at 10:16
  • Maybe it is an android studio bug, try to run your project with your emulator in visual studio code, therefor you need to install dart plugin and flutter plugin in your visual studio code – Ostap Filipenko Oct 26 '20 at 10:52

1 Answers1

4

I finally solved the issue !!!

The following is steps I took to solve the problem:

  1. Deleted Android Studio and all of related folders in the computer.

2-1. Create "src" folder in the C drive.

2-2. C:\src> git clone https://github.com/flutter/flutter.git -b stable

2-1. Type "Environment Variables" in the search box in your computer. 2-2. Under "System Variables > Path", add "C/src/flutter/bin".


  1. Install "Android Studio"

3-1. Android Studio Intro Page > Configure > SDK Manager

enter image description here

enter image description here

enter image description here

3-2. Android Studio > Configure > Plugins > Browse Repositories (Install Dart & Flutter) enter image description here


  1. Go to "C:\src\flutter".

4-1. Run "flutter doctor --android-licenses"

4-2. Run "flutter channel beta"

4-3. Run "flutter upgrade"

enter image description here


  1. Type "Environment Variables" in the search box in your computer.

5-2. Under "System Variables > Path", add the following:

  • C:\Users\USER\AppData\Local\Android\Sdk
  • C:\Users\USER\AppData\Local\Android\Sdk\platform-tools
  • C:\Users\USER\AppData\Local\Android\Sdk\tools

5-3. Under "System Variables", add the following:

  • Variable Name : "ANDROID_SDK_ROOT"
  • Variable Value : "C:\Users\USER\AppData\Local\Android\Sdk"

  1. Go to "C:\src\flutter". 6-1. Run "flutter config --android-sdk C:\Users\USER\AppData\Local\Android\Sdk"

  1. Open Android Studio.

7-1. Ctrl + Shift + Alt + S > Project Settings > Project > Change "<No SDK>" to the latest version. enter image description here

7-2. Click "AVD Manager" icon. enter image description here

7-3. Click "Launch this AVD in the emulato" icon enter image description here


  1. Success!

enter image description here

enter image description here

Lim
  • 753
  • 14
  • 31