Failed to update Android SDK Package List - Unity 2019.2.10f1

When I try to export the game build for the Android platform, I started getting this error:

Within the Project Settings - Minimum API Level and Target API Level not get loaded anyhow! While I have used all default Unity provided settings to export Android build. Here is the image to illustrate this:


Now what to do to solve this error?

I have already read all the threads related to the same problem but overall I can’t able to find the solution that actually worked for me.

Google suggests that you have JDK 9 installed on your system, either uninstall it or try the workarounds described here - android - Failed to run sdkmanager --list with Java 9 - Stack Overflow

1 Like

Thank you for your quick reply :slight_smile:
I have tried to follow the given answer at my best but still, I can’t able to get success.
I want to share screenshots after applying the solution what happened with me:
sdkmanager script updated screenshot:
5725618--600121--sdkmanager script edited.png

In the last point, the person said to run the command but this is happening to me:
5725618--600136--execute command terminal.png

I am noob in executing commands in Terminal so I don’t know what is going wrong!!
So please suggest me further into this.

I have just downloaded all things from the Unity HUB then also this kind of problem occurring that I can’t able to understand.

NOTE: Recently I have upgraded my Java SE, maybe then after problem get started:
5725618--600139--java upgraded.png

Did you try simply uninstalling the system JDK? And reverting back to JDK 8

1 Like

Do you suggest me to remove this version?

5726236--600208--jdk 13 version.png

I have started downloading JDK 8 version:
5726236--600211--jdk 8 version.png

I hope after I remove JDK 13, it will not start creating a problem for other Unity versions.
Because other 2 Unity versions working properly at present :slight_smile:

Which Unity versions are you referring to? if you want to be on the safe side, just have JDK 8 installed.

At present, I was using these Unity versions:

According to Java 9 (JDK 9) support by Unity Android , no external JDK are required. So it should be safe to remove.

I have installed JDK 8 into my computer and restart it too.

5727148--600358--jdk 8 installed.png

But still, the problem is not solved :frowning:

Library and SDK linked to all default places.

when you open terminal and do
java -version

what does it say?

This is the result:

Hmph, well a long shot, but you could try downloading Android Studio, and see if you can build to Android from there.

If yes, in Android Studio change SDK path to point to the on Unity installation path, and try building to Android again

1 Like

Thank you to remain with me in my this problem :slight_smile:
I have already in my system Android Studio exist with this kind of SDK and other packages download:

5730217--600871--android sdk platforms.png

5730217--600874--android sdk tools.png

Now Unity can’t able to accept this Android Studio SDK and the overall situation remain the same.
5730217--600877--android sdk tool linking.png

I mean the other way around, change Android SDK path in Android Studio to point to the one Unity has in its installation path

1 Like

Okay, I have performed the reverse step and try to link Unity SDK with Android Studio.
This is the first step after linking:
5733598--601603--after SDK linking.png

There is some installation required so I have completed that:
5733598--601606--SDK setup complete after installation .png

So this is the situation after Android Studio linking:
5733598--601615--unity sdk android studio linking.png

What is the next step I require to do?

Select API Level 28, and install it, currently it says it’s Partially installed, which is incorrect

1 Like

Yes sir, now API get linked with the SDK successfully and on the spot, library gets loaded in the Unity Project Settings:

5734696--601828--android api level.png

Exactly what is the problem?
Partial SDK or wrong JDK version…

I would guess something with your OS wrong, maybe as soon as you installed newest JDK, it did something… but can’t be sure what.

Glad it works for you now

1 Like

Again I started getting the same error:

Please check this if you can able to help me.

Could you please do this

Create NewBehaviourScript.cs, attach it to some GameObject and run

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    void Update()
    {
       
    }

    private void OnGUI()
    {
        GUILayout.Label(Environment.GetEnvironmentVariable("JAVA_HOME"));
    }
}

I think your JAVA_HOME env variable is incorrect, it should point to OpenJDK inside Unity.

1 Like