(Unity) Your app currently targets API level 30 and must target at least API level 31
Asked Answered
I

2

9

Today I got following warning from Google Play "Your app currently targets API level 30 and must target at least API level 31 to ensure it is built on the latest APIs optimized for security and performance."

How can and where I should specify target API level? To be honest I didn't specify anything. I just recently moved from Unity 2018 to Unity 2020 and got following warning.

How can it be fixed? Thank you in advance

Ingeingeberg answered 25/8, 2022 at 14:18 Comment(0)
B
6

First of all, always ensure you are using the latest stable build of unity. Older versions may not have the new API levels required for the latest android versions.

Then go to: Edit -> Project Settings -> Player -> Other Settings

If you have selected Android as the Build Platform: Under the Identification, there will be a Minimum API Level and Target API Level.

Set the Target API Level to automatic, which will be the highest installed. If you won't have an API Level such as 31, it means you need to upgrade your unity version or install the API level manually.

Beason answered 25/8, 2022 at 15:25 Comment(5)
Ben, thank you very much for your answer. Can you have a glance on this screenshot? i.postimg.cc/QMRJNcmm/api.gif Does it mean that API 31, API 32, API 33 aren't installed and they are just mentioned in the list?Ingeingeberg
Yes, they are installed certainly, make sure the second drop-down, the target API aims at the highest possible. However, if that still does not work, it means that there must be an issue with the build itself. Maybe the aab file is not working, or the build is in the development mode.Beason
No this is wrong form the image posted by @Ingeingeberg you can not know if API 31, API 32, API 33 are installed. If they are not and you start a build process unity will try to install them.Nilotic
Same error here, Hace the same image than Richard, but API 31,32,33 doesn't compile. Setting the Automatic mode doesn't work either. It only works with API 30...Believe
Is it possible to add API level manually to unity 5, bcz it only supports level 28 and to upgrade the project to the latest unity LTS version would mean loosing alot of assets and vfx. So is there a way to upgrade the level to 30 without the need to update to the latest LTS?Hying
F
0

if you have android studio or unchecked the ticks that Unity handles the android SDKs automatically you need to check these two folder

C:\Users\username\AppData\Local\Android\Sdk\build-tools

C:\Users\username\AppData\Local\Android\Sdk\platforms

unity has issue with sdk API 31+ (32 and so on...) unity will download build-tools based on target sdk on player settings, if you set to automatic, it will download highest version (33 right now), which is problematic, set target sdk to 31 or set the Target API Level to automatic, unity will search build-tools folder automatically for highest version which you need to remove any 31+ if unity has downloaded before. if you have android studio targeting 33 for android build u must cut it to desktop and put it back for ur android build.

Fabron answered 16/11, 2022 at 11:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.