Flutter apk file building taking huge time

2.9k Views Asked by At

I am using Android Studio to run Flutter. I have 8GB RAM, 256GB SSD. But whenever I am going to generate an apk file, it's taking an unlimited time. I have tried all possible command like:

flutter build apk --release
flutter build apk --split-per-abi
flutter build apk --build-name=1.0 --build-number=1

But still, the apk is not generating. It is showing:

    Building with sound null safety 
`Running Gradle task 'assembleRelease'...`                               \

What should I do?

3

There are 3 best solutions below

1
On BEST ANSWER

I have found something interesting here. After commanding mentioned command, if I do not close the terminal it's building nonstop. But if I close the terminal and let it go doing my other work, it executes very quickly. I do not know why, but it happens several times here for me.

0
On

first use this command

flutter clean  

and then

flutter build apk --split-per-abi

this command is enough for generating all type apk

0
On

In my case, the problem was solved by deleting a large text file (approx. 25 MB). After that, build app was done without any problems. I had used this file to save some information through Getstorage package.