How to update Target API Level to 30 Android

Hello everyone,
When i submitted my game to Google Play it shows that my game must support at least Android API 29. While my Unity version only support Up to Android API 28. So, I updated my Unity Editor to the latest LTS version and also updated NDK, SDK etc from Unity Hub. But problem not solved. So, I downloaded latest SDK from Android Studio and changed my SDK path to C:\Users\Hi\AppData\Local\Android\Sdk in External Tools
But it still not showing 29 and 30.

Other than that I am getting these warnings in Console:
1)
Observed package id ‘tools’ in inconsistent location ‘C:\Users\Hi\AppData\Local\Android\Sdk\tempToolsDir’ (Expected ‘C:\Users\Hi\AppData\Local\Android\Sdk\tools’)
System.Reflection.MethodBase:Invoke(Object, Object[ ])

File C:\Users\Hi.android\repositories.cfg could not be loaded.
System.Threading.ThreadHelper:ThreadStart()

and in External Tools my NDK is also showing warning that “you are missing the recommended Android NDK…” while I downloaded everything from Unity Hub.
Please help.

hi i’m having the same problem wold like to get some advice

Which errors you are seeing?

I have the same problem. Did you find anything to solve this problem?

Which error are you seeing?

We need help

Hola.

No estoy seguro de si el problema es el mismo, pero creo que sí. Me pasó lo mismo y lo solucioné desde Unity @Ellukitas_123

PlayerSettings >>. Otras configuraciones >> Configuración Nivel de API de destino Debe cambiar el Nivel de API de destino.

Te muestro una captura de pantalla.

Espero que sea la solucion correcta

Suerte


I’m not sure if the problem is the same, but I think it is. The same thing happened to me and I solved it from Unity

PlayerSettings >>. Other Settings >> Configuration Target API Level You must change Target API Level.

6785009--785648--Captura de pantalla 2021-01-31 a las 12.42.14.png
6785228--785687--Captura de pantalla 2021-01-31 a las 12.43.15.png

Muchas gracias

1 Like

My god. Still works like a charm. Gracias mi amigo

2 Likes

I have solved in a different way with these steps:

  • Add support of android in unity. This will make a SDK in the unity editor.
  • Install Android Studio with new SDK. Install android platforms which you want to use in the unity. Also install android build tools of the highest API level.
  • In the new SDK, the platforms which you have installed from android studio copy these platform folders and put these folders in unity android SDK. Also copy the build tools folder from new SDK and paste it in the unity android SDK.

That’s all. Hope this will work!




5 Likes

Also had a problem with updating Android SDK to version 30 in Unity. In my case I had to enter the computer admin PW 3 times, before Unity looped back into the message “update Android SDK…”. No error messages, it was just not able to update. Solution: I went to “preferences”, copied the location of the SDK tools (keep default location by Unity) and opened the location in the file explorer of my compter. From there I opened the folder “SDK” and then “platforms”. It had me to enter my admin PW, which I did. After that, somehow Unity was able to access the folder when I wanted to build the project and update the SDK using Unity’s link. Hope it helps.

1 Like

In my case, I just used the path to my default SDK location which is managed by Android Studio. I guess I can’t open Unity in Administrator mode.

How did you manage to get Unity to do that? Where did you get the enter password prompt?

IT WORKED!! Thank you

Here’s another way to do it.

  1. Install java https://javadl.oracle.com/webapps/download/AutoDL?BundleId=245479_4d5417147a92418ea8b615e228bb6935
  2. Set JAVA_HOME variable Setting the JAVA_HOME Variable in Windows | Confluence Data Center 8.9 | Atlassian Documentation
  3. Open Windows PowerShell as admin.
  4. In PowerShell enter your unity editor “SDK\tools\bin” directory.
    cd "C:\Program Files\Unity\Hub\Editor\2020.3.19f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin"
  5. Run “sdkmanager.bat” with “platforms” parameter.
    .\sdkmanager.bat "platforms;android-30"

That’s it!

8 Likes

That worked perfectly for me!! Thanks for saving me from this frustrating episode! I’ve been stuck on this for longer than I care to admit.

(PS I only did steps 3-5, and it still worked. I guess my Java was already set up correctly)

2 Likes

Thank you so much, this worked great!