skip to Main Content

After updating gradle plugin from 7.1.3 to 7.2.1, when attempting to build and install our app in AndroidStudio I get the error INSTALL_FAILED_INVALID_APK … base.apk is missing.

I noticed, that the built apk file is very small (~6 MB instead of ~20 MB).

When switching back to gradle plugin 7.1.3, everything is fine.

I am using Android Studio Chipmunk 2021.2.1 Patch 1.

6

Answers


  1. Chosen as BEST ANSWER

    Eventually, I found out that the issue was caused by testCoverageEnabled true in my build.gradle buildType. I don't know how and why, and it is not an ideal situation, but removing it, fixed the problem.

    August 16, 2022

    With gradle plugin version 7.2.2 from latest update the problem seems to be fixed and I can again build APKs with testCoverageEnabled true.


  2. Try to remove the old debug app and try again after a clean build

    • rm -rf android/app/build/outputs/apk/debug/
    • Invalidate cache and restart
    • flutter clean
    • flutter pub get
    • flutter run
    Login or Signup to reply.
  3. You can try any one of these

    1. HMS toolkit Uninstall it if its installed
    2. Invalidate Cache and Restart
    3. Delete all build folders and try again.
    4. Build > Clean Project

    Let me know if you have solved it.

    Login or Signup to reply.
  4. a little late.

    There can be multiple possibilities for the issue.

    I also faced this issue back in the day.

    Fix 1 -> your package name must have ‘.’ eg: com.example.app

    Fix 2-> Just remove old APK android/app/build/outputs/apk/debug/app-debug.apk in the folder

    Please do give these a try. I hope your issue gets resolved.

    Login or Signup to reply.
  5. To fix the above issue just remove .idea,.gradle folders from project level
    

    Project Level

    and remove build folder inside app level folder app > build
    

    App Level

    Rerun the app.
    
    Login or Signup to reply.
  6. Just remove old APK android/app/build/outputs/apk/debug/app-debug.apk in the folder. that’s all. enjoy your coding…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search