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

Akif
  • 7,098
  • 7
  • 27
  • 53
Kasun Hasanga
  • 1,626
  • 4
  • 15
  • 35

13 Answers13

37

I solve this problem like this

Only for MacOS

$ ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Chinmay Mourya
  • 764
  • 5
  • 9
MARU
  • 471
  • 3
  • 3
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
Jamilu Salisu
  • 307
  • 2
  • 4
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.

Rafael Bartz
  • 308
  • 2
  • 10
  • 3
    It fixed it for me. I switched to channel beta, 1.23.0-18.1.pre (`flutter channel beta; flutter upgrade`) – rlat Nov 04 '20 at 19:45
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

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)
Boken
  • 4,825
  • 10
  • 32
  • 42
Sunil Kumar
  • 127
  • 2
  • 8
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

Manav Garg
  • 49
  • 2
  • Are you running AS 4.1 or 4.1.1, because I am, and this does not work as expected... – Dan Dec 27 '20 at 02:41
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

Zaenury Adhiim
  • 155
  • 1
  • 6
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
    
1

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

Dharman
  • 30,962
  • 25
  • 85
  • 135
Kira Nofans
  • 176
  • 1
  • 6
  • 20
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

gtxtreme
  • 1,830
  • 1
  • 13
  • 25
  • I have deleted old files. Now what is solution in that case. – Wikki Jan 14 '21 at 10:17
  • 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 – gtxtreme Jan 17 '21 at 16:40
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

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

ARHAM RUMI
  • 441
  • 5
  • 11
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

Syed Usama Ahmad
  • 1,307
  • 13
  • 22