I have a flutter app I've been working on. It was working fine till yesterday. Then I started getting this error when I try to run it on Android:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Exception in thread "main" java.lang.RuntimeException: Gradle distribution 'https://services.gradle.org/distributions/gradle-7.5-all.zip' does not contain any directories. Expected to find exactly 1 directory.
at org.gradle.wrapper.Install.getAndVerifyDistributionRoot(Install.java:115)
at org.gradle.wrapper.Install.access$000(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:76)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1
It started working fine today, then I got this error again for no apparent reason. I was testing the app, I hot-restarted, and I got this error.
I have tried deleting the whole Android project and regenerating it with flutter create my_project_name
, but when the android project got recreated, I got the same error again.
I tried to run it on my physical phone and I got the same error.
Here is the result of flutter doctor:
[√] Flutter (Channel stable, 3.7.10, on Microsoft Windows [Version 10.0.18363.628], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.77.3)
[√] Connected device (3 available)
[√] HTTP Host Availability
Please, what could be the problem?
Update: It's like that for all my projects. Nothing is running. All projects are giving me this same error.