EAS Android build won't succeed. Fails on task :app:checkReleaseAarMetadata.

Hi @markymc

If you create a new Expo SDK 44 app and run expo prebuild it will eject the app (will generate android and ios directories). It can sometimes be useful to do this to see what is happening under the hood. (But if you do this in your own managed app, make sure you have committed all your changes before that so that you can clean up again afterwards.)

I’ve just run expo prebuild in a new blank app and in the generated android/build.gradle file it has the following:

    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
    }

So that’s where the this module's compileSdkVersion (android-30) is coming from in the error message.

As @jmarks.joshua mentioned, the error is likely because you have installed some dependency that has compileSdkVersion (or a related option) set to 31, which is higher than the version specified by the Expo code.

There are a couple of ways to resolve this.

  1. You could downgrade the offending dependency (search for “[Cc]ompileSdk” in build.gradle files under your node_modules.)
  2. Or you could write a config plugin that bumps Expo’s compileSdkVersion. (e.g. something like this might help. I don’t claim to be an expert in writing config plugins, but this seemed to work. That plugin should be marked as “dangerous” because it makes manual changes to the build.gradle)