Unable to install additional SDK platform. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. See the Console for details.
This morning I decided I was going to go ahead and upload to the play store, so I built my APK and uploaded the file to the Play Console and I get this:
"Your app currently targets API level 28 and must target at least API level 29 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 29."
After seeing this, I opened up Unity, visited player settings, and set my max API level to 29. Now I try to build again, and I get this pop up error:
"Android SDK is missing required platform API"
It gives me two buttons to move forward, either "Update Android SDK" or "Use Highest Installed," obviously I don't want to use highest installed because it angers the Android Play Console, so I hit the first one and I get the pop up error in the title of the post:
"Unable to install additional SDK platform. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. See the Console for details."
In the console there is a long license agreement from Android that asks you to accept it, but provides no detail on how to do so. The first thing I did was check the SDKs I had installed in Android Studio. Everything is in order, I have the latest updates and the SDK with API level 29. I went to preferences then external tools, and tried the SDK path from Androids SDK manager as well as the one provided by Unity. No luck. Naturally, I go to the internet for answers. A common denominator among other people with the same problem also have another error that I have been neglecting, except it's just a warning, which is why I neglected to fix it:
"File C:\Users\harpe.android\repositories.cfg could not be loaded."
I follow up the forums and I find that the common fix is to create a repositories.cfg in the location that it is missing, and then use a 'touch' command on it, which I can not figure out how to get work. Then they type in some other commands, I'm assuming into the Windows command prompt that messes with this bat file:
C:\Users\harpe>C:\Program Files\Unity\Hub\Editor\2020.1.1f1\Editor\Data \PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat
They either use an "--update" or "platforms;android-29" command on it and then they say it's fixed, but for me it just gives me yet another error:
JAVA_HOME is not set and no 'java' command could be found in your PATH.
Apparently the license that you can agree to from the error in my console is maybe contained in this bat program or something but I can't seem to open it and I have no idea how to.
Any help would be very appreciated. Thanks.
Answer by harperrhett · Aug 06, 2020 at 10:42 PM
Hi, I fixed this problem by downloading Android SDK tools, downloading the SDK version I wanted, and then dragging that version into the place where Unity stores its SDK versions (if you've downloaded any at all). I changed my default location for Android but if you find your folder then the versions are under platforms, and you can drag your desired version to "C:\Program Files\Unity\Hub\Editor\2020.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms" but that path will change depending on the version of Unity you have as well as which drive Unity is stored on. Make sure that in the Unity editor under "preferences>external tools" you have "Android SDK tools installed with Unity" turned on. Anyways good luck, I spent hours figuring this out.
Hi I am having the exact same issue as the OP. How or where did you download the Android SDK tools? Did you have to download Android Studio first?
I downloaded Android Studio. by default it saved the platforms at
C:\Users\<user>\AppData\Local\Android\Sdk\platforms
Copied them from there and build worked.
Thanks for debugging this. I was moments away from taking a bat to my monitors.
I made a video to help anyone else who may stumble across this & have the same issue https://www.youtube.com/watch?v=O3AHZVEDAQY
Thanks a lot all of you! Incredible video incredible solutions. You are insane!
Thank you that was incredibly helpful. I was able to post my new app without issues following this solution.
Worked like a charm. Props and thank you for finding the solution.
This is the fix. I downloaded Android Studio, used the SDK $$anonymous$$anager to download API 29 & 30 (with the 30.0.2 build-tools), then copied the android-29 & android-30 folders from the Android Studio install location to the Unity SDK location.
That introduced the "license issue" where you need to "accept the license." The google solution says to just copy the license folder from the SDK $$anonymous$$anager location to the "new machine" or in this case the Unity SDK location.
The license issue resolved then caused a Read only issue to crop up (fixed with permissions on Users (\Users) changed from read access to full access on the Unity SDK folder and all children.)
And also copied over the build-tools folder (30.0.2) from the SDK $$anonymous$$anager location to the unity location to stop the "sdk tools version 0.0 < 26.1.1" pop-up.
Answer by maciejhd · Nov 17, 2021 at 07:49 AM
This one worked for me without installing external tools
Your answer
Follow this Question
Related Questions
PLEASE HELP, BUILD APK ERROR 0 Answers
Build error Execution failed for task ':packageReleaseBundle'. 0 Answers
il2cpp Build error,Exception: F:\Unity2018\Editor\Data\il2cpp/build/il2cpp.exe did not run properly! 1 Answer
Script updater failed to produce updates.txt file 0 Answers
Win32Exception build error 1 Answer