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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug SOLVED: Cannot create local Android build with SDK level 33

Discussion in 'Editor & General Support' started by benjamin_schmithuesen, Mar 15, 2023.

  1. benjamin_schmithuesen

    benjamin_schmithuesen

    Joined:
    Jul 23, 2020
    Posts:
    6
    Host OS: Windows 11
    Unity version: 2021.3.16f1
    Android Target SDK version: 33

    Since Unity does not ship with a recent enough Android SDK for that version, I have configured Unity to use the Android SDK that I installed through Android Studio. That has always worked fine. Recently, I reinstalled everything and since then, I'm always just getting this error message:

    Code (CSharp):
    1. java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    -----------

    SOLUTION: I describe the solution in this comment. You just copy the platform folders from the separately installed SDK to the one provided by Unity.
     
    Last edited: May 8, 2023
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    You probably also need to update the jdk.
    2021 LTS should support all android versions needed to publish
     
  3. benjamin_schmithuesen

    benjamin_schmithuesen

    Joined:
    Jul 23, 2020
    Posts:
    6
    Thanks for the reply!

    Unity itself states that it only support this specific version of the JDK (1.8) https://docs.unity3d.com/Manual/android-sdksetup.html
    I can still try to make it use a newer one, of course.

    2021 LTS might meet the current minimum, but “Starting in August 2023 new apps must target Android 13 (API level 33) or higher” https://developer.android.com/google/play/requirements/target-sdk
    We are now working on an app which is supposed to release later this year so that's our target.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    Ahh, missed the new requirements.
    I assume Unity will support it in a newer 2021.3LTS, but cannot be sure. Hope someone responds who got it working. Did see a video about it on YouTube, but I am not developing for GPlay
     
  5. benjamin_schmithuesen

    benjamin_schmithuesen

    Joined:
    Jul 23, 2020
    Posts:
    6
    I envy you :D
    Thanks anyway! I will update this thread if I make any progress.
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    Join the VR developers then (;
    More talent is definitely welcome
     
    craipes26 likes this.
  7. benjamin_schmithuesen

    benjamin_schmithuesen

    Joined:
    Jul 23, 2020
    Posts:
    6
    I don't know if that's the video you were referring to, but I found one and it actually helped me! The important part is to copy the SDK from where Android Studio installed it into the Unity install. I was pointing Unity to my SDK install folder of course, but something seems to be different this way. Maybe it's because you only copy the android-33 folder, but not the surrounding SDK so Unity can use its own stuff for everything else. Great news, anyway.
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    I found this:
     
    benjamin_schmithuesen likes this.
  9. sandbaydev

    sandbaydev

    Joined:
    Aug 9, 2013
    Posts:
    104
    Since I happened to google and find my way to this thread as well, also going to add my solution to build target api 33

    I was on Unity 2019.3.17f1
    -> got error with API 33 and complains about java 54 vs 55

    I solved API 33 issue by upgrading project to Unity 2022.2.18
    -> problem solved. Works OK.

    I pushed app version to google play for beta testers and it works OK.
     
    DevDunk likes this.
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    Latest 2020 and 2021 LTS versions also have supporte