Unity: Guide To Fixing Common Errors For Android Build Errors

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.
  1. 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 )
  2. Rename the old Android sdk “Tool” folder : [Your Android SDK root]/tools -> toolsXXXX
  3. Download Android SDK Tools, Revision 25.2.5 (January 2017): http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
  4. Extract that to Android SDK root folder.
  5. 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!)
  6. 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.

Leave a Reply