First I tried installing Android SDK and an older Version of JDK into folders with only three letters in the folder name directly on the desktop. But this was not the solution.
Then I fixed it by downgrading the android sdk tool version. Obviously the most current version (SDK Tools, Revision 25.3.0 (March 2017)) causes the trouble.
This is how you do it:
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
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!)
Build your project.
Worked fine for me!
Here some other guys who found the solution too:
This stupid version compartibility issue took one day to solve…
I met the same “Error Message” Thanks to @DjangoJG I know it is the stupid “tools” fail
so i try the following command and see Exception, The problem depends on your detail exception. For me it happens when I have java7 install while android classes are java 8 later. so upgrade to Java 8
cd D:\Android\sdk ools
android.bat list target
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/android/s
dklib/tool/AvdManagerCli : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Still having this issue on september 27th 2017. This fixed it for me, but left me with a new issue (and googling says I need newest android SDK to fix it…)
“Failed to Sign APK Package. See console for details”