I am trying to build the android apk of a simple python flet application on my Windows 10 machine. However, despite the fact that I have installed Android Studio, flutter, Java SDK, gradle, accepted all the licences, and set all the system paths, I am still encountering the error below:
[13:08:01] 1 Failed to validate Flutter version.
Flutter 3.27.4 installed ✅
[13:08:08] JDK installed ✅
Android SDK installed ✅
[13:08:29] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref "0.27.6" ✅
[13:14:38] Packaged Python app ✅
[13:14:55] Customized app icons ✅
[13:15:38] Generated app icons ✅
Customized app splash images ✅
[13:16:04] Generated splash screens ✅
[13:16:48]
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... 32.8s
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all artifacts for configuration 'classpath'.
> Failed to transform gradle-1.0.0.jar (project :gradle) to match attributes {artifactType=jar, .gradle.category=library,
.gradle.dependency.bundling=external, .gradle.internal.hierarchy-collected=false,
.gradle.internal.instrumented=instrumented-project-dependency, .gradle.jvm.version=17, .gradle.libraryelements=jar,
.gradle.usage=java-runtime}.
> Could not read workspace metadata from C:\Users\IFEANYI\.gradle\caches\transforms-4\3693a314d72045c583dc22f194ba8794\metadata.bin
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .
BUILD FAILED in 7s
Gradle task assembleRelease failed with exit code 1
[13:17:08] Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.4, on Microsoft Windows [Version 10.0.19045.5247], locale en-NG)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.45)
[√] Android Studio (version 2024.3)
[√] Connected device (3 available)
[√] Network resources
• No issues found!
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ Error building Flet app - see the log of failed command above.
I have even tried downgrading my flet package to version 0.24, but that could not even interact with my pyproject.toml
file. I have also tried out the suggestions in this SO post to no avail.
Please if anybody has any idea on what to do, I would really appreciate your sharing. Thanks!