Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Cannot Build To Android For SDK reasons

Discussion in 'Android' started by danielrconrad, Sep 1, 2023.

  1. danielrconrad

    danielrconrad

    Joined:
    Apr 19, 2021
    Posts:
    15
    I currently cant find any way to build my android game. I've tried a multitude of different things and gotten alot of different errors on it. First without changing settings and using the sdk and gradle that come with Unity (version 2022.3.8f1) I get the error :
    Android SDK does not include your

    Target SDK of 28.
    Please use the Android SDK Manager to install your target SDK version. Restart Unity after SDK installation for the changes to take effect.

    I've tried different SDKs bot none of them work and I get the same error with a different SDK.
    After installing the sdk, command line tools and setting the directory through the manager I avoided this error but got another one :

    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
    java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    I installed the latest JDK (20) but Unity tells me it only works with version 11. This would mean that it just cant build it as I would need version 17 to reach it. Is there anything else I can do to build successfully?
     
  2. aagarwal_unity

    aagarwal_unity

    Joined:
    Sep 14, 2021
    Posts:
    1
  3. danielrconrad

    danielrconrad

    Joined:
    Apr 19, 2021
    Posts:
    15