Search Unity

Still "Target Android SDK of 24 not installed" after it had been installed by Android Studio setting

Discussion in 'Android' started by UltraSENRON, Jun 6, 2018.

  1. UltraSENRON

    UltraSENRON

    Joined:
    Jun 6, 2018
    Posts:
    7
    Unity Build.png SDK platform.png SDK tool.png version.png

    I had installed the Android SDK version 7(24) platform and tool by the Android Studio SDK manager and setting, why is there still the error message: "Target Android SDK of 24 not installed" from the Unity buliding?
     
    Last edited: Jun 6, 2018
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Most likely you have two separate android sdk installations in different locations on your system. Could you go to Unity Preferences -> "External Tools" and double check if Android SDK path there is the same as SDK path specified in the Android studio C:\Users\SENRO\AppData\Local\Android\Sdk ?
     
    Last edited: Jun 6, 2018
  3. UltraSENRON

    UltraSENRON

    Joined:
    Jun 6, 2018
    Posts:
    7
    Thank you very much.

    The Android SDK path in Unity Preferences -> "External Tools" is "C:\Program Files (x86)\Android\android-sdk", should I change the Android SDK Location to it?
    auto detected.png SDK location can not be Program Files (x86) ‘ Android ’ android-sdk.png
     
  4. UltraSENRON

    UltraSENRON

    Joined:
    Jun 6, 2018
    Posts:
    7
    I changed the Target API Level from 7.0(24) to Automatic (highest installed) Change the Target API Level from 7.0(24) .png

    and then it passed

    Change the Target API Level to Automatic (hightest installed) .png

    but is it sure the Target API Level is 7.0(24)? What difference? Is 7.0(24) not the highest installed version? I only installed 7.0(24) platform and tool by the Android Studio SDK manager and setting.

    However, it seems I have a new problem about the driver.
     
    fundaaydn56 likes this.
  5. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    You can either change Android SDK manager to point to this path (you will have to re-download needed parts, so it's not great) or you can change Unity Editor to point to "C:\Users\SENRO\AppData\Local\Android\Sdk" where Android SDK manager has already downloaded everything that you need (I'd suggest to do this).

    It's hard for me to say what will be used exactly (because I'm not sure which SDK location you have set in your Unity Editor and what exact components are installed there), but you can easily check it yourself. After successfully building the apk, examine <your_project_location>\Temp\StagingArea\AndroidManifest.xml file that Unity has generated. Open that file and check which Target API Level was set there.

    Make sure you've enabled development mode on your Android device and you've allowed your computer to connect to it. After plugging in the device to your computer, a popup should appear on device's screen asking if you trust the computer. Select to always trust it. Hopefully that will solve your issues.
     
    UltraSENRON likes this.
  6. UltraSENRON

    UltraSENRON

    Joined:
    Jun 6, 2018
    Posts:
    7
    Thank you very much.

    I'm reinstalling the Android SDK to the path I decided by the Android Studio SDK manager, and I will set the external tool path in the Unity to be this. I do not understand why was it installed in the path of a user account in default? I installed the Unity and then the Android Studio without any other action or modification, just let it been automatic in default, I don't know why were there two different SDK paths automatically setting by Unity and Android Studio?

    However, I was sure the development mode of the handy device was enabled, so it might be the problem of my workstation.

    Thank you very much.
     
  7. UltraSENRON

    UltraSENRON

    Joined:
    Jun 6, 2018
    Posts:
    7
    Thank you so much, JuliusM.

    It was due to the wrong path setting.
    Now there is no problem.

    Thank you so much.
     
  8. LarryTheBrave

    LarryTheBrave

    Joined:
    Nov 20, 2016
    Posts:
    24
    I found that one thing is copy the SDK folder with that particular version to the sub-folder in Editor where other SDK(s) are, and change the Target API to automatic highest installed. Try it. I had some luck with that.
     
  9. sonupanda1995

    sonupanda1995

    Joined:
    Jun 28, 2018
    Posts:
    1
    Just changing the target Api to automatic highest installed worked for me
     
    TripleADevs likes this.
  10. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    I'm confused. I have the same error. Used the SDK manager in Android Studio to download 21 and yet build failed. I had 'Android SDK Tools Installed with Unity (recommended)' ticked, so couldn't see an SDK location. I untick this and can choose a path where I find I have "C:/Android/SDK" and "C:/Android/Android StudioSDK".

    I assume Android Studio updates AndroidStudioSDK. Fair enough, but then how am I supposed to use Android SDK Manager to update Unity's SDK? Is there a Unity Android SDK Manager I don't know about?
     
    cacolukia likes this.
  11. SoftwareGeezers

    SoftwareGeezers

    Joined:
    Jun 22, 2013
    Posts:
    902
    So yeah, there's an Android SDK manager in Unity I didn't know about. And I can't remember where one reaches it. Possibly in Unity HUB, click your project's three dots > Add modules > Select Android there, maybe.
     
  12. kj343565

    kj343565

    Joined:
    Apr 30, 2020
    Posts:
    2
    VResearch and MrKiskers like this.