Geoff
Geoff

Reputation: 743

Flutter doctor reports seeing two installations of Android Studio

Why is flutter reporting both a valid and an invalid installation of Android Studio at the same location? The error encountered is below:

Sat Dec  1 10:52:34 AEDT 2018
flutter_app $ flutter doctor -v
[✓] Flutter (Channel beta, v0.11.12, on Linux, locale en_AU.UTF-8)
• Flutter version 0.11.12 at /home/jedaa/bin/flutter
• Framework revision 06ec8d3b41 (2 days ago), 2018-11-28 15:56:58 -0800
• Engine revision 72c7a75672
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /home/jedaa/bin/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/jedaa/bin/Android/sdk
• Java binary at: /home/jedaa/bin/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.

[✓] Android Studio (version 3.2)
• Android Studio at /home/jedaa/bin/android-studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Android Studio
• Android Studio at /home/jedaa/bin/android-studio/
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• android-studio-dir = /home/jedaa/bin/android-studio/
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at /opt/idea
• Flutter plugin version 31.1.4
• Dart plugin version 183.4733

[✓] VS Code (version 1.29.1)
• VS Code at /usr/share/code
• Flutter extension version 2.21.0

[!] Connected device
! No devices available

When i load AS and run the default app .. i get this in the event log:

10:51 AM    Unable to list devices: Unable to discover Android devices. 
Please run "flutter doctor" to diagnose potential issues

11:13 AM    Emulator: Couldn't statvfs() path: No such file or directory

11:13 AM    Emulator: qemu-system-x86_64: warning: host doesn't support 
requested feature: CPUID.80000001H:ECX.abm [bit 5]

Emulators are available

Can you please assist in resolving this issue, thanks.

Upvotes: 12

Views: 17255

Answers (7)

Just re-install android studio but first check if there are other folders with the name Android Studio in the path C:\Program Files\Android, if you see one or more folders with that name, delete them and then reinstall Android studio.

Upvotes: 0

Anwar MA
Anwar MA

Reputation: 1

I am using Linux Mint and I resolved this by deleting a linker called (android-studio) in the directory /opt/, there was two folders with the name android studio:

  1. android-studio
  2. android-studio-2022.3.1

the first one was a linker to the other, so I deleted the linker and ran flutter doctor, the issue was resolved

in your case you would find similar duplication of folders where you installed android studio, probably in the directory: /home/jedaa/bin/

Upvotes: 0

Ian White
Ian White

Reputation: 91

FYI - if you happen to have a time machine usb drive plugged in, any vscode and android installations get noticed and shown. Explains why my usb drive is unexpectedly busy. Eject it and do flutter doctor again.

Upvotes: 0

PRO8L3M
PRO8L3M

Reputation: 31

I deleted flutter's and Android Studio directories, I installed they again, and the problem quickly back.

But I tried these two commands, and they proved to be helpful:

$ flutter config --android-studio-dir=""
Removing "android-studio-dir" value.

$ flutter config --android-sdk=""
Removing "android-sdk" value.

Upvotes: 3

aka4rKO
aka4rKO

Reputation: 51

Deleting the folder with the config files of the previous versions of Android Studio solved me the issue. I had 2 versions of Android Studio after it updated.

.AndroidStudio3.3 
.AndroidStudio3.4

So I deleted the config files of version 3.3(.AndroidStudio3.3) and kept only the config files of version 3.4(.AndroidStudio3.4)

You can find these folders in the home directory if you're a Ubuntu user and you did a default installation for Android Studio. These folders are hidden so you will have to un-hide them first.

Be sure to import the previous settings when prompted after the update or else you will have to re-install all the dependencies you worked with before deleting the old config files.

Upvotes: 5

Geoff
Geoff

Reputation: 743

the issue was SOLVED by the following two flutter commands!!! ...

flutter config --android-sdk /path/to/android/sdk
flutter config --android-studio-dir /path/to/android/studio

Upvotes: 3

Anthony Fok
Anthony Fok

Reputation: 381

I recommend clearing the android-studio-dir and android-sdk settings, and let flutter automatically detects their path instead:

$ flutter config --android-studio-dir=""
Removing "android-studio-dir" value.

$ flutter config --android-sdk=""
Removing "android-sdk" value.

Upvotes: 26

Related Questions