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 is outdated

Discussion in 'Android' started by aronsommer, Jun 2, 2020.

  1. aronsommer

    aronsommer

    Joined:
    Dec 5, 2010
    Posts:
    196
    I am using Unity version 2019.3.15f1 on macOS Catalina 10.15.5.

    When I build and run for Android I receive following error message:

    Android SDK is outdated
    SDK Tools version 0.0 < 26.1.1.

    Error-message.png

    When I than hit the Use Highest Installed button it will build without problems to my device.

    When I hit the Update Android SDK button I receive this message:

    Android SDK is outdated
    SDK Tools version 0.0 < 26.1.1.
    Make sure Android SDK path is writable by the Editor.

    Error-messag2.png

    I have Unity installed via the installer and not via Unity Hub.
    So I can not add Android Build Support modules to the Unity Editor via Unity Hub.

    Here are my Preferences with the External Tools paths:

    Preferences.png

    And here are my installed SDK Tools in Android Studio version 4.0:

    SDK-Tools1.png SDK-Tools2.png
     
    Deleted User likes this.
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    This is a known issue, the fix is on the way.
     
  3. aminthemar

    aminthemar

    Joined:
    Jun 17, 2020
    Posts:
    1
    I've had the same problem too!

    In my case, I realized that Unity is looking into the [YOUR_SDK_DIR]\tools\package.xml file in order to read the SDK tools version and check its compatibility.

    Strangely enough, the XML file was weirdly formatted and my theory is that Unity just wasn't able to locate the version parameters so it replaced them with 0.0 by default.

    (As shown here, my sdk version is 26.1.1 according to package.xml but unity couldn't see it.)
    <revision><major>26</major><minor>1</minor><micro>1</micro></revision>


    At last, I just edited the XML file and reformatted it so that Unity can easily read the version properties and after a restart, it worked perfectly!
    I have attached the TXT version here for structure reference and wouldn't recommend you using my exact values.

    I hope this works for you as well.
     

    Attached Files:

    Last edited: Jun 17, 2020
  4. aronsommer

    aronsommer

    Joined:
    Dec 5, 2010
    Posts:
    196
    Thank you @AminTheMar for your reply!

    I have now compared your package.xml file to my current one which gave me the error (Android Studio 4.0) and also to another one on my other computer which uses still Android Studio 3.4.

    Your package.xml file and the one from Android Studio 3.4 have set the xml element obsolete="false".

    My current package.xml file from Android Studio 4.0 have set the xml element obsolete="true".

    @JuliusM I have changed the xml element in [YOUR_SDK_DIR]\tools\package.xml from obsolete="true" to obsolete="false" and this fixed the error.

    I will attach the original and the fixed package.xml file to this message.
     

    Attached Files:

  5. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    We do not read this file ourselves. We use sdkmanager and its output. Unity 2019.4.1f1 will work with "Android SDK Command-line Tools" component, so the "Android SDK Tools (Obsolete)" component won't be needed there.
     
  6. AlphaLion911

    AlphaLion911

    Joined:
    Oct 1, 2016
    Posts:
    4
    Awesome.. It works Nicely .. Thumbs up... saves us the pain in the as* for every build...
     
  7. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
    problem fixed here :
     
    Last edited: Aug 23, 2020
    jayconsystems, DhiaSendi and mruva like this.
  8. Tubbritt

    Tubbritt

    Joined:
    Nov 30, 2015
    Posts:
    46
    Just wanted to say thank you. That package file has greatly reduced my frustration with 2020.1 :)
     
  9. BossBarforn

    BossBarforn

    Joined:
    Nov 29, 2018
    Posts:
    2
    i have the same proplem and the same unity version as you . Iam using uniy skd recomend and i can not fine the package.xml in my sdk foder. where did you find it ?
     
  10. Tubbritt

    Tubbritt

    Joined:
    Nov 30, 2015
    Posts:
    46
    Hi BossBarforn.
    It's located here...
    C:/Users/YourUserName/AppData/Local/Android/Sdk/tools/

    Kind regards
    James.
     
    studentartist likes this.
  11. plasticYoda

    plasticYoda

    Joined:
    Aug 20, 2013
    Posts:
    62
    I just did this on mac, the only difference was I had to restart Unity to have it stop with the warning dialog.

    For me the file was located at:

    ~/Library/Android/sdk/tools/package.xml
     
    aminthemar likes this.
  12. smotocel

    smotocel

    Joined:
    Aug 31, 2020
    Posts:
    1
    Hello,
    I had the same issue to, and i found out it was because i have unchecked the "Android SDK tools installed with Unity" just like you have on your picture the preferences with the External Tools.
     
  13. studentartist

    studentartist

    Joined:
    Apr 2, 2020
    Posts:
    1
    Thank you so much for posting this location! I was getting frustrated because I couldn't find it. :)
     
  14. girlsthatlgirls

    girlsthatlgirls

    Joined:
    Oct 14, 2020
    Posts:
    1
    the hell it is. this crap happens EVERY time i use unity. problem and bs and after crap that wastes weeks of my life trying to fix YOUR problems. cant u ppl earn even a little bit of the money u steal?
     
    ekoops and snow-botta like this.
  15. ahmedaniss

    ahmedaniss

    Joined:
    Sep 18, 2019
    Posts:
    98
  16. Narendra_Reddy_137

    Narendra_Reddy_137

    Joined:
    Aug 26, 2021
    Posts:
    2
    TheVirtualMunk likes this.
  17. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    139
    Same issue here; unity 2022.2.0b4
     
  18. socialtrens

    socialtrens

    Joined:
    Oct 23, 2017
    Posts:
    46
    I have no problem with 2021.3. But today, I tried 2022.2, this message came up.
     
  19. Andreas215

    Andreas215

    Joined:
    Jul 20, 2017
    Posts:
    1
    I ran into this issue today with 2021.3.6f1.

    First I had to update the Android SDK using the command line since the "Update Android SDK" Button does not work because someone at Unity thought it is a good idea to create a temp folder here

    Error building Player: UnauthorizedAccessException: Access to the path 'C:\Program Files\Unity\Hub\Editor\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tempToolsDir' is denied.

    where non-admin users cannot write.

    So I updated the Android SDK manually using the command line. After this I ran into this issue. Unity is unable to read the correct SDK Platform Tools version.

    I found no fix and I'm sorry to say that Unity developer support is just terrible. This issue was reported in June 2020 and there is still no solution.
     
  20. dtaddis

    dtaddis

    Joined:
    Oct 17, 2019
    Posts:
    20
    I updated to 2022.2.0b5 today, and hit this problem as well.

    Tried to update, but get: "UnauthorizedAccessException: Access to the path 'C:\Program Files\Unity\Hub\Editor\2022.2.0b5\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tempToolsDir' is denied."

    If I look in the SDK directory, there is no package.xml at all, perhaps that is the breaking change?