I updated Flutter to the latest stable version today - 1.12.13+hotfix.7 (I was running 1.12.13+hotfix.6 before). When I tried to run my project in vs code with flutter run it always gets stuck at Running Gradle task 'assembleDebug:
Have anyone experienced the same issue?
Here is the output of flutter doctor -v:
[georgi#georgi-pc Line-up-Generator]$ flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Linux, locale en_GB.UTF-8)
• Flutter version 1.12.13+hotfix.7 at /home/georgi/Development/flutter
• Framework revision 9f5ff2306b (2 weeks ago), 2020-01-26 22:38:26 -0800
• Engine revision a67792536c
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/georgi/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /opt/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.5)
• Android Studio at /opt/android-studio
✗ 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_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• MI 8 • 62fb6fd8 • android-arm64 • Android 10 (API 29)
! Doctor found issues in 2 categories.
I have to point out that I have tried running flutter doctor --android-licenses but it gets stuck at 25%
Note: I am on Manjaro 18.1.5
UPDATE:
There seems to be an issue with Dart SDK: https://github.com/flutter/flutter/issues/49185#issuecomment-589968058
flutter clean worked for me
I had the same issue. I tried so many solutions and finally found on Github. Try this command in the terminal.
The issue has been resolved upstream. If you want to consume it you will have to switch to the master channel (for now. It will arrive in the stable channel at some point) by running
flutter channel master
After running that, I was able to build my apk just fine on Linux 5.5
I had the same problem and solved it.
I ran flutter doctor --android-licenses as sudo.
I used the whole path, don't know if that's necessary though.
For example I did it like that:
sudo /home/jan/development/languages+devtools/flutter/bin/flutter doctor --android-licenses
After that everything worked.
I tried every answer I found about it, but none of them worked.
Finally I fixed it by deleting the Android Virtual Device I had and creating a new one. In my case looks like it was a problem with the android emulator rather than a flutter bug.
Related
I've been trying to get my Flutter project to run after upgrading it to 2.10.4 and it's been a headache from the start. The project runs fine on a browser, but I'm having difficulty running on an Android emulator. I think I'm at the last hurdle, but I'm stumped right now. I'm receiving this error when running on VS Code:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following SDK components:
build-tools;30.0.2 Android SDK Build-Tools 30.0.2
The SDK directory is not writable (C:\Program Files (x86)\Android\android-sdk)
Here's my Flutter Doctor:
PS D:\Documents\Flutter_Projects\glance> flutter doctor -v
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19043.1586], locale en-US)
• Flutter version 2.10.4 at D:\Programs\flutter_windows_v1.2.1-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Program Files (x86)\Android\android-sdk
• Platform android-31, build-tools 30.0.3
• ANDROID_HOME = C:\Users\reff1\AppData\Local\Android\Sdk
• ANDROID_SDK_ROOT = C:\Users\reff1\AppData\Local\Android\Sdk
• Java binary at: D:\AndroidStudio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
• Android Studio at D:\AndroidStudio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
[!] Android Studio (version 4.1)
• Android Studio at D:\Programs\AndroidStudio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
X Unable to determine bundled Java version.
• Try updating or re-installing Android Studio.
[√] VS Code, 64-bit edition (version 1.50.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.17.0
[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1586]
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.88
• Edge (web) • edge • web-javascript • Microsoft Edge 99.0.1150.46
[√] HTTP Host Availability
• All required HTTP hosts are available
Here's the part that keeps getting me. I'm seeing I need to run flutter doctor --android-licenses and this is what I get:
PS D:\Documents\Flutter_Projects\glance> flutter doctor --android-licenses
Error: Could not find or load main class Files
I have no clue where to go from here. Any help would be greatly appreciated here. Thank you in advance.
It appears that you have two sets of Android Studio and Android SDK.
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Program Files (x86)\Android\android-sdk <--- 1
...
• ANDROID_HOME = C:\Users\reff1\AppData\Local\Android\Sdk <--- 2
[√] Android Studio (version 2021.1) <--- 1
• Android Studio at D:\AndroidStudio
...
[!] Android Studio (version 4.1) <--- 2
• Android Studio at D:\Programs\AndroidStudio
Android Studio version 4.1 is a bit older so I guess you installed it in the past and forgot about it.
Also, it is not normal (or up-to-date) to have Android SDK placed under Program Files.
This is the direct cause of the error. In Windows, writing files under Program Files requires administrator privileges.
Your system is possibly confused because you have a mixed environment with an SDK that requires administrator privileges and one that does not.
My advice is to first uninstall all of them.
Before you begin, find out where the Android Studio configuration files are stored and backup them.
It is documented in here.
Now, completely uninstall all versions of Android Studio and Android SDK, manually delete all environment variables related to Android if any, manually delete (and backup) all configuration files if the uninstaller did not, then make sure all four directories above are empty.
Next, install the latest version of Android Studio and install the Android SDK via Android Studio. At this point, make sure that the installation directory is not under Program Files or Program Files (x86). If it is, then something in the older version is still there and is doing bad things so you have to restart from the first step.
Finally, run flutter clean (just to be sure), then flutter doctor to make sure only one of each is detected.
In android studio update your sdk 30
Unable to determine bundled Java version.
• Try updating or re-installing Android Studio
See in your error in flutter doctor
Change the ownership of Android SDK:
sudo chown -R $(whoami) $ANDROID_HOME
For this issue : Android license status unknown.
Type in command prompt
flutter doctor --android-licenses
Type Yes/y/Y to accept licenses
Maybe it's an emulator specific issue, did you try to run it on a real device?
Regarding the android license issue you are getting, I guess that the system is not recognizing JAVA or it needs to be updated so please check that.
Also make sure that the emulator itself is updated and not only the android SDK, go to SDK manager and check all the dashed components:
If this didn't work, delete the emulator and create a new one, and if that didn't help, delete all instances of android studio as I see 2 on your system that might conflict the SDK path.
So today I freshly installed android studio for flutter. I followed every step given on the flutter website. Yet I came across multiple issues at different point of time.
List Of Events:
1. Tried to run the app, the Gradle task assembleDebug Kept On loading and i found out i need to install Android API 28, That being done now came the
C:\Users\DELL\AndroidStudioProjects\example>flutter run
Launching lib\main.dart on ASUS X00TD in debug mode...
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 38.3s
Gradle task assembleDebug failed with exit code -1
After wandering of the internet, One solution prominently given was to install the 'Android SDK Tools (Obsolete). turns out i have already installed it.
Click Here For The Snapshot
Now running upon flutter doctor it shows
C:\Users\DELL>flutter doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
• Flutter version 1.12.13+hotfix.5 at C:\flutter\flutter
• Framework revision 27321ebbad (6 months ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\DELL\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed
instructions.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.45.1)
• VS Code at C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.11.0
again wandering on the internet i found out that this error might have to deal with it. so again the same solution came up : install the 'Android SDK Tools (Obsolete).'
running upon flutter doctor --android-licenses
it showed that sdkmanager is missing. so i manually downloaded the commandtoollines from the android studio website(this one had 'sdkmanager.bat' which was missing in the orginal one;, and pasted it to the required folder. Now I am getting a new error yay!!!!!.
C:\Users\DELL>flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
C:\Users\DELL\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
So i would highly appreciate someone if anyone could help me out.
In Android Studio, there is a tab at the bottom of the screen that says Terminal,
This is where this tab is located at the bottom of the screen
Copy and paste the following statement into the terminal and run it
C:\Users\DELL\AppData\Local\Android\sdk\tools\bin\sdkmanager --update
Hopefully after the update is done, things should go alright. Otherwise, you might need to run some other statements and check what else is missing. Installing Android studio may be a bit tedious because it depends on a lot of factors to run properly.
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.
If you are working on Windows OS,
Close Android Studio
End process related to Flutter & Android Studio IDE from Task Manager.
Then, delete everything from Temp folder (run %temp% to open it directly).
Now, Open Android Studio and your Flutter project.
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
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
Well, a month ago I was learning a bit of Flutter, and it was all fine, no problems, so, last week I lost everything in my PC, and need to format it, I did. So yesterday I tried install Flutter but, when accepting Android Licenses, it gave me this error:
Warning: File /home/damiani/.android/repositories.cfg could not be loaded.
To solve this i just touch .android/repositories.cfg and this message doesnt appear anymore, but now, when I flutter doctor --android-licenses it gave me this:
[========= ] 25% Fetch remote repository...
From this, I can't do anything, it just get stucked in there... Sometimes even give this:
[============================= ] 75% Computing updates...
Or this:
[======================= ] 58% Computing updates...
The longer it gets is here:
1 of 6 SDK package license not accepted.] 100% Computing updates...
Review license that has not been accepted (y/N)? y
1/
And from there, this message doesn't change...
When doing flutter doctor -v:
[✓] Flutter (Channel master, v1.14.7-pre.120, on Linux, locale pt_BR.UTF-8)
• Flutter version 1.14.7-pre.120 at /home/damiani/flutter
• Framework revision 82c00c915c (3 hours ago), 2020-02-05 06:35:49 -0800
• Engine revision 81dffd1241
• Dart version 2.8.0 (build 2.8.0-dev.7.0 c8ed304e97)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/damiani/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /var/lib/snapd/snap/android-studio/82/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Android Studio (version 3.5)
• Android Studio at /var/lib/snapd/snap/android-studio/82/android-studio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
! Doctor found issues in 1 category.
No mood to continue with Flutter. Thanks since now...
sorry for bad english
os: arch linux
switching to flutter dev channel fixed the problem for me. run
flutter channel dev and then flutter upgrade and try
flutter doctor --android-licenses
Try to run the following commands,(It should ask you to accept the licenses)
sdkmanager --licenses
And also make sure to run the following
flutter config --android-sdk /pathToAndroidSdk --android-studio-dir /pathToAndroidStudio
After the above two commands I hope your problem should be resolved.
Thanks :)
This occurs because you haven't accepted all the android licenses.
Follow these steps, this worked for me.
Open console/terminal
Type flutter doctor --android-licenses
Accept every license that comes up, press y and you are good to go.
Considering that I had followed all this steps https://flutter.dev/docs/get-started/install/linux in my Ubuntu 18.04LTS, why this following problem continues to appear:
$ flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.2, on Linux, locale en_US.UTF-8)
• Flutter version 1.7.8+hotfix.2 at /opt/flutter
• Framework revision 2e540931f7 (2 weeks ago), 2019-07-02 09:31:07 -0700
• Engine revision b1cb0d9e9b
• Dart version 2.4.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/rodrigo/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/rodrigo/Android/Sdk
• Java binary at: /usr/share/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 /usr/share/android-studio
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build
1.8.0_152-release-1343-b16-5323222)
[!] Android Studio
• Android Studio at /opt/android-studio
✗ 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_152-release-1343-b16-5323222)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API
29) (emulator)
! Doctor found issues in 1 category.
Different from another similar questions here in StackOverflow, before I've installed flutter plugin the "[✓] Android Studio (version 3.4)" was equal to "[!] Android Studio", with same error messages. After I've installed flutter plugin (and dart), only "[!] Android Studio" still displaying the error.
Does someone know why? I've made many searches in my files, I have only one Android Studio installed. Why displays two? What "[!] Android Studio" refer to? Does command "$ flutter doctor" have a problem?
This post is for those who have gotten the plug-ins installed but still receive the warning.
Note: The Flutter team has created an issue for the inability of doctor to detect installed plug-ins. It's a know issue and they are looking to deprecate this detection feature of doctor:
https://github.com/flutter/flutter/issues/61246
My flutter and dart plug-ins are correctly installed but I still get the warning.
[!] Android Studio (version 4.0)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
In my case ignoring the warning worked fine.
I tried re-installing plug-ins several times but that did not remove the warning from flutter doctor.
However, everything works fine. I can successfully create and run apps created from
the command line with flutter create
from Android Studio with File->New->New Flutter Project
I'm on Ubuntu 20.04 LTS and Android Studio 4.0.1 (installed through JetBrains toolbox)
I installed flutter via the snap store:
sudo snap install flutter --classic
sudo snap install flutter-gallery
flutter channel dev
flutter upgrade
flutter config --enable-linux-desktop
# wanted to try web, apparently requires beta channel
flutter channel beta
flutter channel upgrade
flutter config --enable-web
FYI, it took me a while to understand where the Flutter SDK was located. It is here: /home/(username)/snap/flutter/common/flutter
Plugins installed correctly, but still get warning:
This can be solved in simple steps:
Step 1: Open Android Studio
Step 2: Open Android Studio Preferences
Step 3: Go-to Plugins tab
Step 4: Click on MarketPlace tab
Step 5: Search for flutter in search box
You will see a list of plugins related to flutter. Click on the first one and check which version it is. Currently, the latest version is 37.1.1.
Step 6: Click on install. (It may ask you to install dart plugin also. Hit yes and android studio will install dart and flutter for you)
Ready to rock !
I recently encountered this problem, I first tried to update the flutter and dart plugin from the android studio market place, but that did not work
Finally, I run the following command and it worked like a charm
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
Note: I'm on Mac OS running android studio 4.1