Search code examples
fluttergoogle-playbundle

Getting "You've been importing an invalid ZIP file" when trying to upload my android (flutter) bundle to play store console


I don't know what to do to get rid of this error.

I build (successfuly) my bundle like so:

$ flutter build appbundle

💪 Building with sound null safety 💪

Running Gradle task 'bundleRelease'...                             17,6s
✓ Built build/app/outputs/bundle/release/app-release.aab
(61.1MB).

But when I try to add the aab file to the plays tore console page, I sometime get the following error (The translation from French stands for "You've been importing an invalid ZIP file"):

error
app-release.aab


Vous avez importé un fichier ZIP archive non valide.

I trie to $flutter clear Androidbut this makes no difference. I also tried to up the build number and generate a new bundle, but this makes no difference I still stick with the error.

I finally have to mention that I usually don't have any error.

Where does it come? What should I do?


Solution

  • I finally found out why I'm getting this error every now and then. I never turn off my MacBook nor I close vscode or my projects. And What I think the reason is, is that with time going on, vscode or whatever flutter tools, comes unable to perform a normal build despite the appearance.

    Anyway, to fix it:

    • just close vscode;
    • do a flutter clean;
    • and finally flutter build appbundle.

    Your bundle will be processed by Play store without any issue.

    Hope it helps!