Unity Editor: Guide To Fixing Common Errors For Android Build Errors
1 min readMar 18, 2018
1. Unable to list target platforms :
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
- Go to your Android SDK Folder. (If you did not change the path during Android Studio installation you will find the SDK folder here: C:\Users\YourUsername\AppData\Local\Android\sdk )
- Rename the old Android sdk “Tool” folder : [Your Android SDK root]/tools -> toolsXXXX
- Download Android SDK Tools, Revision 25.2.5 (January 2017): http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
- Extract that to Android SDK root folder.
- In Unity go to Edit>Preferences>External Tools and check again, that the path for Android SDK points to the correct folder. (The correct path is the SDK root folder, not the tools folder which is inside the root folder!)
- Restart your computer, you will have problem #2 if you don’t.
(Unity Answer: source)
2. ADB Server Version Doesn’t match: Restart Your Computer
ADB Server version (31) doesn’t match client (36); killing
Restart your computer, you probably fixed #1 and didn’t restart.
3. Java Version Incorrect: You need JDK 1.8 specifically
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
Download JDK 1.8 and fix the JDK path in Unity, go to Edit>Preferences>External Tools and change to your new 1.8 path in C:\Program Files\Java
Feel free to ask in comments.