Search Unity

Android SDK is missing required platform API

Discussion in 'Android' started by kdeger, Aug 10, 2018.

  1. kdeger

    kdeger

    Joined:
    Mar 4, 2018
    Posts:
    22
    Hi guys,

    I just received this annoying error yesterday while building my APK. I searched the forum and tried everything I can do but couldn't find any solution. The interesting thing is at around 11 am my build was successful without any errors, even I uploaded it to Play Console. I tried to upgrade and downgrade the SDKs within Android Studio, update the Android Studio itself, change the path of the SDKs, gave permission to the folder which holds the SDKs, basically tried everything I know. Also from Unity updating the SDK doesn't work and the SDK path is correct. Uploaded some images. 2018-08-09 23_41_50-Unity 2018.2.2f1  _2.png
    2018-08-09 23_42_09-Unity 2018.2.2f1 _3 .png

    Urgently need your help guys.
     

    Attached Files:

  2. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Can you please share your editor.log?
     
  3. kdeger

    kdeger

    Joined:
    Mar 4, 2018
    Posts:
    22
    The log is attached.
     

    Attached Files:

  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Okay, your paths are not in the log - what is the path to your SDK, and what's the content there?
    Are you sure the path to android sdk in unity is set to this path?
    As a guess, can you please try run Unity as admin once to allow for the SDK update, if nothing else helps.
     
  5. kdeger

    kdeger

    Joined:
    Mar 4, 2018
    Posts:
    22
    I checked the path where SDKs are loaded and nothing seems wrong, the path content and unity external tools windows are attached. Also tried to run Unity as admin but unfortunately the error remains. The weird thing is I didn't change anything before the error as I mentioned I built an APK wtihout any error in the same day.
     

    Attached Files:

  6. muaslam

    muaslam

    Joined:
    Oct 28, 2018
    Posts:
    1
    Hi kdeger,

    I am facing the same issue, did you find a solution? If yes, please share for me and others who are facing similar issue.


    Thanks,
    Umar
     
  7. kdeger

    kdeger

    Joined:
    Mar 4, 2018
    Posts:
    22
    Hi Umar,

    Unfortunately I couldn't find a solid answer but backup the project and formatting the pc solved my problem.

    Hope this helps.

     
    erenaydin likes this.
  8. midhapulkit28

    midhapulkit28

    Joined:
    Jan 18, 2019
    Posts:
    9
    I'm having the same error. help me anyone?
     
  9. Valhalaru

    Valhalaru

    Joined:
    Feb 3, 2016
    Posts:
    9
    Alright, I had the same issue, and I solved it.

    What is happening with that warning notification, is Unity is complaining that it can't point to the correct Android SDK Tools that your project desires. The one that comes with Unity sometimes doesn't have all the latest Android API versions, and SDK Tools. So if you set your project to be Max API 29, or 30 (max at the time of writing this), but Unity doesn't have it as part of its install, it gives you this warning.

    Solution:
    1. Download Android Studio

    2. In Android Studio goto Tools->SDK Manager

    3. Download and update all the latest SDK Platforms and SDK Tools. So in my case I went to the SDK Platforms Tab and downloaded Android 10.0 (Q) platform. Then I went to the SDK Tools tab and installed: Android SDK Build-Tools; Android SDK Command-line Tools; Android SDK Platform-Tools (and anything else you may want).

    4. After installing the desired SDK Platforms, and SDK Tools, take note of your Android SDK Location. In my case it was "C:\Users\milam\AppData\Local\Android\Sdk". See pic below.
    upload_2020-8-21_12-26-47.png

    5. In Unity goto Edit->Preferences and uncheck the box "Android SDK Tools Installed with Unity (recommended)". Then, goto "Browse" and have it point to the SDK Tools you just installed from Android Studio, at the Android SDK Location. See pic below.
    upload_2020-8-21_12-30-13.png

    6. Now goto File->Build Settings
    Voila! You should be able to build to your testing devices, and export your build just fine!
    I hope this helps you. =)
     
  10. akashjohny02

    akashjohny02

    Joined:
    Mar 30, 2020
    Posts:
    6
    not solved
     
  11. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I just had this problem with Unity 2019.4.12f1
    The issue was the default path for the Android NDK was wrong.
    Correcting it manually in Preferences -> external tools -> NDK path fixed it.
    It was trying to find the NDK in "C:\Program Files\Unity\Hub\Editor\2019.4.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK"
    but inside that folder was yet another folder with the NDK in it, so the correct path was:
    "C:\Program Files\Unity\Hub\Editor\2019.4.12f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\android-ndk-r19"
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    Could you try reinstalling, I just checked, and seems NDK is in correct folder, there's no android-ndk-r19 subfolder
     
  13. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I already completely uninstalled and reinstalled using the latest Unity Hub.
    The android-ndk-r19 subfolder is generated on install and it's not the first time that happens: this exact same issue has happened before on other Unity versions.
    Maybe it's an installer bug or maybe it's an Unity Hub bug, but it's definitively creating that extra folder.
     
  14. Huldor

    Huldor

    Joined:
    Apr 9, 2017
    Posts:
    9
    For me it worked after hours or trying to fix it, to chance "platforms;android-29”(look for “platforms;android-“ in the file, in case it shows a different version) to highest installed sdk (for me 30) to ”platforms;android-30" in the “index.js” file on mac, *use the search function in OS to find it (with an up to date android studio SDK).

    But then after a few hours the error can return… To then fix it again you need to chance the API level in Unity "PlayerSettings" to a random API level and then chance it back to the desired API level. This seems to rebuild file's and fix the error!

    Hope it helps!