Build APK stuck at Task :app:checkReleaseAarMetadata

210 Views Asked by At

i am new in flutter.

When i run:

flutter apk build -v

it always stuck at

[+29946 ms] > Task :app:checkReleaseAarMetadata

I left it for almost an hour and nothing, same happen when i run it on release or debug on my own device via usb debugging, but run perfectly on emulator on debug mode

any help would be appreciated, thanks

2

There are 2 best solutions below

0
On BEST ANSWER

Thanks, I found the solution.

In the end tried to clean install Android Studio including sdk, gradle, etc by deleting android studio related stuff on %APPDATA%, %USERPROFILE%, %LOCALAPPDATA%.

After that i build the apk again from vscode console and it work.

I think the error occurred because of missing stuff in gradle or error during sdk installation.

3
On
add the following line to android/build.gradle.try it and update is it fixed!
buildscript {
    ext {
        androidXCore = "1.7.0" // <-- Add this line
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
    }