AppCenter Not Building Native Android APKs? Try this…

Posted: December 11, 2020 in Android, Software Development
Tags: , , , ,

So I recently ran into an issue where Microsoft AppCenter wouldn’t build my Android APK… It would find the source, build successfully, then fail to find the resulting APK.

If you’re running into this issue, try the following:

This is based on @johnclarete’s idea, which I had to modify due to it relying on Flutter’s config.

  1. Modify the build.gradle file in your Application folder as follows:

Find the android { part of the file and paste in the buildTypes part:

android {
    compileSdkVersion 30

    buildTypes {
        appcenter {
            applicationVariants.all { variant ->
                variant.outputs.all {
                    def currentFile = new File(outputFileName)
                    def filename = currentFile.getName()
                    outputFileName = "../../../../../Application/Application/build/outputs/apk/${filename}"
                }
            }
        }
    }
  1. In AppCenter, you should now have an “appcenter” Build Variant option.
image
  1. Disable Build Android App Bundle.

That worked for me. I hope this helps others.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s