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.
↧