When the bug is actually outside your computer, Flutter Android gone wrong

A bit of context

As often in my free time, I really enjoy spend some time working on side-projects, some are real products, for communities or good initiatives I support, some are just challenge projets. I never force myself too much because I don’t want it to ruin my health, so I only do it when I like it, when it feels great to experiment, research, help people and so on.

This week I worked on a mobile application I’m building since a few month already, and it’s made using Flutter, my current favorite cross-platform framework.

Problems appeared

As usual, I plug my Xiaomi Mi 11T using a USB-C to USB-C cable to my Apple Silicon MacBook Pro (ARM), then proceed with a very classic command:

flutter run --debug --flavor dev -t lib/main_dev.dart

Nothing exotic so far, my dependencies are up-to-date, the project was running with the exact same code a few days ago.

Then installation of the debug APK on my phone fails, with this message.

/app-dev-debug.apk: Failure
[INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from
/data/app/vmdl1235095091.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not
Error launching application on 21081111RG

If you have this problem, click here to jump directly to the solution that worked for me.

Typing this in Google was really disappointing, as well as asking ChatGPT for debug methodologies around this problem.

The extreme debug process

I started by the basics: checking that my devices was correctly connected, with ADB enabled, USB debugging enabled, “install apps over USB” in the developer settings. Opening a shell using ADB is possible, I can list the files on my phone, this is good sign. Also device explorer in Android Studio is able to connect. I also turned off the “Verify apps over USB”, just in case.

Definitely a nominal situation on the ADB connection side. ✅

Reading a few StackOverflow and Reddit post, a few people had similar problems with APK being huge like 2.5Gb, or not having enough storage available on the phone. I have 120Gb free on my phone, my APK is around 20Mb. Should fit 🤨

So except those storage issues, some people having similar issues pointed out the signature of the APK that could be wrong. I check my Gradle configuration, my keystore files and variables, re-created a keystore file, tried to sign my APK myself with apksigner command line tool in Android SDK, verified the signature using the same tool… So far so good.

Well if my APK is small, valid, signed, I have storage available on my device, ADB connection is fine, then what is happening!?

Then I tried to run this Flutter application on my girlfriend’s Android phone. Turns out, it’s working perfectly. So it’s not a project issues, and also, the fact that the error message is mentioning my phone’s storage (/data/app/vmdl1235095091.tmp/base.apk), is quite interesting and concerning at the same time.

I tried to read a little bit this folder on my phone using file explorer and command line, but it’s barely impossible to do anything since permissions are quite strict on those folders and because my phone is not rooted, I barely can do anything about that.

Reboot everything, just in case

I rebooted my MacBook, rebooted my phone… Then took the heartbreaking decision to reset my phone to factory settings. After a few hours of backups, synchronisation, reset, restore, and basic configuration, it’s time to give it a another shot.


I felt dumb to have done all this, especially reseting my phone, and having no solution in sight.

Maybe it’s simply that something is broken in my tooling, Gradle, Flutter, Java JDK, Android SDK. Let’s try some other projects, I have a React-Native project nearby, let’s try this!

And guess what. Same issue with React-Native. Anyway I decided to consider updating tools, since I had few other options at this point.

Update tooling, SDKs, JDKs, and basically everything

I started to remove all Java JDK versions on my computer, including those automatically embedded in Android studio and went with a fresh OpenJDK 19 installation. I removed the Android SDK, downloading a fresh one from official website, upgraded Gradle to a newer version, upgraded Flutter.

During this process I was using flutter doctor -v a lot since it’s really helpful to have a great overview of your setup. All Google licenses accepted, flutter doctor -v is green for a new try.


Back to research and the 🎉 / 🤦‍♂️

Then I decided it was time again to think, research, and stop trying thousand things. Googling was a bit frustrating because I sometimes visited pages 5 times, reading the same thread answer by answer, and it really felt like nothing was related to my issue, or some ideas were already tried hours ago without success.

I randomly ended up on a QT.io forum. This one.

See this answer? I unplugged my USB-C to USB-C cable, took a HooToo USB-C hub, and plugged my USB-A to USB-C cable.

And it worked.

Just to be sure it was actually the problem, I tried around 5 times using each of those cables.

  • USB-C to USB-C cable: 100% failures
  • USB-A to USB-C cable: 100% successful


Now explain this: I was already using this USB-C to USB-C cable for months. Also, it’s capable of charging a phone, transferring files, and I also used this cable to test the installation on my girlfriend’s phone, and it worked.

How did this cable suddenly become partially unusable with my phone, although it’s in perfect conditions, it has all other capabilities still, it works with other phones…? I have strictly no idea, wtf.


I’m super happy to have been through this debugging process, because I learned many things, especially around Android SDK tooling, Flutter configuration and so on.

Also it’s a great example of situations which require to sit back, think, not exclude any possibility, and do some accurate research and debug.

Feel free to comment, to react on the debug methodology, or if you faced similar issues or situations, and I’m also open to questions. 💬

Leave a Reply

Your email address will not be published. Required fields are marked *