- Home /
Probably stupid simple - Unable to build android apps
Hi all, I'm sure this is a stupidly simple issue that's going to make me look like a total noob (which I am), but I don't seem to be able to build android apps at all. This problem seems to occur on both the Windows and Mac versions of Unity 5.6.0f3.
I have the latest versions of both the Android SDK and JDK installed on both machines, but keep getting the below error when I try to build:
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/Bennage/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
What am I missing? If I point Unity at the latest JDK (8.0_121) then I get the error: "Invalid JDK home selected"
If I download the older 7.0_80, it seems to accept it, but then fails to build with the above error.
Any advice much appreciated. Sorry if this is simple to fix, but I've tried searching for answers everywhere with no luck.
TIA
Set the JD$$anonymous$$_HO$$anonymous$$E and JAVA_HO$$anonymous$$E in your environmental variables.
Answer by danmw3 · Apr 10, 2017 at 03:10 PM
Make sure you have the latest JDK installed and make sure your JDK_HOME and JAVA_HOME environment variables are set. Here is a guide for setting up the environment variables.
Answer by LIBennage · Apr 11, 2017 at 04:19 PM
I had already done that. However I found the solution elsewhere.
I replaced the 'tools' folder in the SDK with the tools in "tools_r25.2.3-[OSX/WINDOWS/LINUX.zip" at the bottom of this website: https://developer.android.com/studio/index.html
All sorted now. Thanks anyway!
Your answer
Follow this Question
Related Questions
Build Error "Failed to compile resources with the following parameters: -bootclasspath" 3 Answers
Build error 0 Answers
Android sdk build error 10 Answers