29

I have got a similar question like this. But this problem occurred after updating Android Studio to version 4.1 from version 4.0.

using flutter flutter doctor -v

enter image description here

8
  • There are lots of similar questions about it these days. I think there is a problem related to upgrading the Android Studio. Do you able to run Flutter App still? I can run the Flutter App successfully even I got the same error message. Commented Oct 16, 2020 at 19:24
  • Yes, I can run and work on my project. But when I try to export the flutter app it will be bother. Commented Oct 16, 2020 at 19:29
  • It will be bothered. You are right. Still I can build my app with flutter build appbundle. Commented Oct 16, 2020 at 19:32
  • Yes, I got the same complain here but all working just fine. Commented Oct 17, 2020 at 3:17
  • @Akif it can't machn said 'android path is not defined' Commented Oct 17, 2020 at 6:51

13 Answers 13

37

I solve this problem like this

Only for MacOS

$ ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Sign up to request clarification or add additional context in comments.

2 Comments

@KasunHasanga I believe it creates symbolic links so that flutter doctor sees the files where it expects them to be.
it works on macos BigSur, android studio 4.1.2, thanks
19

Switch from Flutter 1.22.2 channel stable to channel dev and you're good to go.

Copy and paste this in your cmd:

flutter channel dev

flutter upgrade

Comments

11

It is a flutter issue on 1.22 version, and happens after upgrading to Android Studio 4.1. It was already fixed on 1.23 version (dev channel). You can continue to run and work on your projects normally until this fix isn't ported to stable channel, or you can swith to dev channel and call flutter upgrade.

1 Comment

It fixed it for me. I switched to channel beta, 1.23.0-18.1.pre (flutter channel beta; flutter upgrade)
6

As said above, it is just a time-being issue. You can change channels by running flutter channel dev. To know available channels you can run flutter channel

2 Comments

I see your android-studio-dir is not found. You need to change the directory so it can do it. Also, check if you have JAVA_HOME settled in your system variables
Can you explain how it view
3

first enter to terminal : flutter channel dev

second enter to terminal : flutter upgrade

it is working fine once download new version of flutter

Latitude-3400:~$ flutter channel dev

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║ A new version of Flutter is available!                                     ║
  ║                                                                            ║
  ║ To update to the latest version, run "flutter upgrade".                    ║
  ╚════════════════════════════════════════════════════════════════════════════╝


Switching to flutter channel 'dev'...
git: From https://github.com/flutter/flutter
git:  + be9bc8cb39...022b333a08 beta   git: Branch 'dev' set up to track remote branch 'dev' from 'origin'.
Successfully switched to flutter channel 'dev'.
To ensure that you're on the latest build from this channel, run 'flutter
upgrade'
sunil@sunil-Latitude-3400:~$ flutter upgrade
Downloading Dart SDK from Flutter engine 20caf549695193a9920ca37752eca4f141bbef31...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed               -> origin/beta  (forced update)

Comments

3

Try the following:

  • Open Android Studio
  • Go to Preference -> Plugins
  • Search for Flutter plugin and install flutter plugin

It will install all the dependent plugins like the dart plugin etc.

Run "flutter doctor -v" and you will see that the issue is resolved.

enter image description here

1 Comment

Are you running AS 4.1 or 4.1.1, because I am, and this does not work as expected...
3

Checkout Flutter channel stable to channel dev and you're good to go.

Copy and paste this in your cmd:

flutter channel dev
flutter upgrade

If you get the error when checkout flutter channel, that's mean you have any changes on flutter SDK. So, go to path of Flutter SDK directory, and open it to your editor, my flutter SDK: C:\src\flutter . How to find the path of Flutter SDK? Run flutter doctor -v, The first line will show the install path. Add any new or modified files by git add . Or git stash to ignore the changes. You can checkout to another channel now

Before enter image description here

After enter image description here

Comments

2

I had the same problem. What helped me:

  1. removing the old IDE configuration directory:

    rm -r .AndroidStudio4.0/
    
  2. let flutter know where Android Studio is installed, for example

    flutter config --android-studio-dir="/home/piotr/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6858069"
    
  3. switch to dev channel:

    flutter channel dev && flutter upgrade
    

Comments

1

Update the Android Studio to the latest version, then try to update the flutter version and build.gradle version

1 Comment

In android/build.gradle, find dependencies, change the build:gradle: [version]
1

This issue has happened due to the change in the configuration (config) directories in Android Studio version 4.1

You can read about it here

TLDR: Just copy the old files to the new directory and you're good to go

How I managed to fix it :

  1. On initial run , Android Studio 4.1 gives a popup to delete unused directories. DON'T DELETE IT . Press OK and proceed.Setup as usual

  2. Now go the directory where your old Android Studio files were present (Find them below)

    Windows: C:\Users\YourUserName\AppData\Roaming\AndroidStudioVersion

    Linux: ~/.config/AndroidStudioVersion

    macOS: ~/Library/Application Support/AndroidStudioVersion

  3. Keeping Android Studio open, Open your file manager and transfer all the old directories and files found in the directory specified in Step 2 above to the new config directory structure (Find them below)

Windows:C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1

Linux: ~/.config/Google/AndroidStudio4.1

macOS: ~/Library/Application Support/Google/AndroidStudio4.1

4.That's it. Switch to Android Studio and there should be a popup below to update to the latest versions of all plugins respectively

2 Comments

I have deleted old files. Now what is solution in that case.
Hey @Wikki I am surprised this issue is still there What I did was just copy the files from my Linux installation path mentioned above to my mac ( I have a dual boot) That fixed everything for me Another way could be reinstalling
1

The solution in Windows is quite simple, you just have to open AS and go to the 'Android SDK' part, then to 'SDK Tools'. Activate 'Show Package Details' and from there select 30.0.0 let it download and it works

Comments

1

I was having the same problem. Just follow the given steps to solve it

  1. Make sure DART and FLUTTER Plugins are successfully installed in ANDROID STUDIO

  2. Try restarting ANDROID STUDIO

  3. If still get the same error, then run the following commands to upgrade Flutter version to beta, as this version (1.22.6 stable) is constantly throwing the same error maybe you can call it a bug in the release. Copy them both and paste it in the CMD(run as ADMINISTRATOR)

    flutter channel dev

    flutter upgrade

This worked for me

Comments

0

hello everyone I had the same issue and non of the above answers fixed so I went to the flutter official GitHub and found the answer there here is the link and you have to follow all these steps.

https://github.com/flutter/flutter/issues/67986

flutter upgrade

flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"

for mac you can do the following as answered by Andrew

ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

flutter doctor -v

then if the issue still persistes then just shift to the beta channel and the upgrade flutter then it will fix it.

flutter channel beta

flutter upgrade

you can enable flutter web as an optional steps

https://flutter.dev/docs/get-started/web

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.