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

Android SDK does not include your Target SDK of 28

Discussion in 'Android' started by Dawdlebird, Nov 10, 2020.

  1. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    I've seen a few posts with the same issue, but I haven't found a solution anywhere and this is driving me crazy. What am I missing here?
    I've installed the android SDK from Unity hub (latest version, up to Android 29)
    2020-11-10 10_16_16-Window.jpg

    I've set all paths to their recommended defaults
    2020-11-10 10_16_58-Window.jpg

    I've had Target API on 'highest', but on startup it mentions jetifier and suggests setting it to 28 (which should work, so why not?)
    2020-11-10 10_16_41-Window.jpg

    But then on build...
    2020-11-10 10_15_24-Window.jpg
    I've seen people suggest to install Android Studio and just set SDK paths to the SDK that comes with that, but doesn't that defeat the purpose of having an Android component installed from Unity Hub?
     
    Don_Doh likes this.
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    I don't know what mentions jetifier for you, however you should be aware that if you plan to upload your app to the Google's PlayStore, it has to target API level 29.
    Now what you see is not a bug. There were issues related to SDK components discussed in other threads, however this is not one of them. When you set the Target API Level in Unity's editor, the exact API must be installed. As can be seen in your first screenshot, the SDK contains only API level 29 (platforms\android-29). If you want to target API Level 28, it has to be installed as well. As it's a lower API level than the latest installed, Unity asks you to manually install it using the SDK manager. You can do this:
    • From Windows menu (left bottom corner), type cmd, right click, Run As administrator
    • Enter this command
    Code (CSharp):
    1. "C:\Program Files 2\2019.4.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat" "platforms;android-28"
     
    zezba9000, davies14, Petr777 and 7 others like this.
  3. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Thanks, manually setting it to version 29 did the trick. My bad; I was under the assumption higher versions covered lower ones. Jetifier is mentioned on startup: When my project is set to use "highest installed" Android SDK:
    2020-11-10 12_35_42-Window.jpg
    (which should be 29) it seems to default to 25, so when I launch the editor I get this warning:
    2020-11-10 12_30_37-Window.jpg
    If I click "yes" I end up with the target SDK set to 28 and the original problem ensues (since I have 29 installed, not 28). But manually setting it to 29 solved the issue! It would seem that there is a bug with the "Automatic (highest installed)" setting for Target API Level (defaulting to 25). And Jetpack enabling switching to 28 instead of 29 isn't ideal either of course.
     
    Last edited: May 12, 2022
    dilaragoral, Danief_, okkurd and 9 others like this.
  4. Don_Doh

    Don_Doh

    Joined:
    Sep 6, 2020
    Posts:
    2
    Thank you very much :)
    I have been fighting with the same issue for some time now, and it were starting to drive me crazy, but this thread helped me solve the problems I had with this.
     
  5. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,134
    Which 2019 LTS contains android 29?
    2019.4.18 installs with 28 I thought and complains about Jetpack (AndroidX). I have no clue what that is about or if any plugins are at fault

    When I say set it to 28 it throws a warning:
    Failed to determine the most recently installed Android SDK version. Please report this as a bug with the version of Unity you are using at: https://github.com/googlesamples/unity-jar-resolver/issues Resorting to reading a fallback value from the editor preferences GooglePlayServices.PlatformVersionFallback: 25
     
  6. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,723
    Got similar issue with 2020.2.1f1 after importing Facebook-sdk-9.0.0.
    Target API Level to Automatic(highest installed) fixed the issue.
     
    D00MX and mehmetkemal like this.
  7. Camovega

    Camovega

    Joined:
    Sep 8, 2019
    Posts:
    1
    Gracias, me estaba volviendo loco!!
     
  8. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    So a few versions later, it seems this is still happening: manually setting the Player Settings target to API 29 is required, because 'Automatic "highest installed" ' still sets it to 25 (very much *not* the highest installed, which still triggers a Jetpack compatibility error).
    I reckon you stopped following this thread @JuliusM , since you haven't commented after stating this is not a bug, but you might want to reconsider that assessment, because this definitely is.
     
  9. JonSolo0504

    JonSolo0504

    Joined:
    Apr 11, 2021
    Posts:
    1
    I ran Into the same issue just now. I had to manualy select my target to 29. Thank you for all of your help!
     
  10. thisisdivakars

    thisisdivakars

    Joined:
    Aug 24, 2021
    Posts:
    1
    how to set manually
     
  11. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    Go to Player Settings -> Select Android -> Other Settings -> For Target API select API 29 (As of now API 30 is recommended at the time of this response)
     
  12. yymqwl

    yymqwl

    Joined:
    Jun 19, 2015
    Posts:
    1
    you must download target android sdk like this
    upload_2021-11-19_11-53-6.png
    Notice:The sdk directory must be in unity
     
    angganaro3 likes this.
  13. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Hm, I think this confuses the issue... this thread is not about how to install other versions of Android; it's about Unity's "target level: highest" has unity point to a missing SDK, and how manually setting it to an installed one fixes this. Installing the missing SDK would obviously also help, but is not per se the quickest way to get past this issue (especially since the above requires you to also install Android Studio). You can install Android SDK's directly via Unity, but that might run into Administrator right issues... there is a thread on how to solve that (by writing a small .cmd file with a few instructions) https://forum.unity.com/threads/and...itional-sdk-platform-issue-workaround.963626/

    just scroll down to @skdev3 's post to see what that .cmd file should look like
     
  14. swfl20

    swfl20

    Joined:
    Sep 15, 2021
    Posts:
    1
    How did you get to this UI?
     
  15. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    that's Android Studio
     
    angganaro3 likes this.
  16. luciano_unity

    luciano_unity

    Joined:
    Nov 4, 2017
    Posts:
    6
    Grappled with this issue for about an hour. Wound up uninstalling / reinstalling every Unity installation on my machine, which also worked.

    Just mentioning it here in case people can't find another workaround.
     
    LilGames likes this.