This is taking an unexpectedly long time

Viewed 3283

When I am trying to add new dependency (packages) using flutter pub get in my flutter project i am getting This is taking an unexpectedly long time message. All other commends working fine like flutter run, flutter doctor etc. Only for flutter pub get i am facing this issue. That's why i am unable to add new dependency (packages) in my flutter app.

Result of flutter doctor -v

[✓] Flutter (Channel stable, v1.17.0, on Linux, locale en_IN)
    • Flutter version 1.17.0 at /home/suhask/private_work/Flutter/SDK/flutter_linux_1.17.0-stable/flutter
    • Framework revision e6b34c2b5c (9 days ago), 2020-05-02 11:39:18 -0700
    • Engine revision 540786dd51
    • Dart version 2.8.1


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/suhask/Android/Sdk
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /home/suhask/install_soft/android-studio-ide-183.5522156-linux/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Android Studio (version 3.4)
    • Android Studio at /home/suhask/install_soft/android-studio-ide-183.5522156-linux/android-studio
    • Flutter plugin version 39.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)

• No issues found! 

If anyone know how to solve this problem please help.

3 Answers

If you are working on Windows OS,

  1. Close Android Studio
  2. End process related to Flutter & Android Studio IDE from Task Manager.
  3. Then, delete everything from Temp folder (run %temp% to open it directly).
  4. Now, Open Android Studio and your Flutter project.
  5. Run flutter pub get, it will work now.

Use flutter pub get --verbose to get more info.

I had the same problem, i did the next

uninstall the android studio, i installed the 4.0.1 version

enter image description here

Also I deleted the flutter sdk and download again in the page official

flutter

Finally i executed the command 'flutter doctor'

[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Versión 10.0.18363.1016], locale es-ES)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [!] Android Studio (version 4.0) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [!] IntelliJ IDEA Community Edition (version 2019.3) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [!] VS Code (version 1.48.1) X Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [!] Connected device ! No devices available

! Doctor found issues in 4 categories.

it permits to create a success project

Related