Unity AndroidSdkVersions.AndroidApiLevel29 is missing

Viewed 569

The Google Play now requires all apps to target Android 10. I am trying to update the Android Target SDK to Android 10 (SDK 29) in Unity 2018.4.

I am trying to set it via code.

PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevel29;

However, the enum AndroidSdkVersions does not have AndroidApiLevel29.

In the meanwhile, I can still manually choose Target SDK in Project settings.

1 Answers

As I found out the Unity 2018.4 still can build for Android 10, while it does not have the enum key AndroidApiLevel29

The easy fix would be:

PlayerSettings.Android.targetSdkVersion = (AndroidSdkVersions) 29;

Note. If you use Google Play Services Resolver (you probably use it). You should update to the latest version because old ones may not work.

Related