EAS Change the target Sdk version (Android)

Hi,

I want to know how change the target SDK for Android release.

What I have done so far:

When I want to publish my application on the play store my AAB file, I’ve this message:

Your application currently targets API level 30. However, it should target at least API level 31 in order to rely on the latest APIs optimized for security and performance. Change your application’s target API level to at least API level 31.

So I searched in the documentation anything to override the default setting (API 30) and I found this expo-build-properties

I’ve done this :

Installed the dependencie in the project with the example command in the documentation

And added the default example in my app.json, here is it what I added :

[
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 31,
            "targetSdkVersion": 31,
            "buildToolsVersion": "31.0.0"
          }
        }
      ]

After that, I’ve try to built the project with this eas command:

eas build --platform android

At the end of the build, I downloaded my AAB file and I published on the PlayStore but I had the same message at the beginning…

Your application currently targets API level 30. However, it should target at least API level 31 in order to rely on the latest APIs optimized for security and performance. Change your application’s target API level to at least API level 31.

I want to know if I need to add one unknown argument to my command or anything else…

Here my configuration:

eas-cli/0.60.0
darwin-arm64
node-v16.13.0
expo : 43.0.5
react-native: 0.64.3

Thank in advance !

hi there! you are using expo sdk 43, which did not support expo-build-properties.

notice that if you go to expo-build-properties docs page for sdk 43 it is not found and redirects: https://docs.expo.dev/versions/v43.0.0/sdk/build-properties/

this api was added in sdk 45, and so you will need to update to sdk 45 to use it

1 Like

Hi brents,

Thank you for your answer,

Now I know what I need to do !

also – sdk 45 targets android api 31 by default

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.