So, about half a year ago i used unity learn how to build android app. Downloaded JDK, SDK, NDK and everything worked fine. I was building my game and it was working on my phone.
And here’s my problem. About 3 days ago I wanted to build new version. It said that SDK has some kind of problem and need to check it. So I did… First i thought that I need to update versions of android. I went to SDK\TOOLS\android.bat and it just flashed and won’t open. I was googling about 3 days and nothing works, all threads about it are from 2013 and some are not availble to do anymore and other just do not work. I’ve reinstalled JDK, JAVA, SDK… still nothing. I’ve changed set=java.exe in find-java and still not working. I was trying everything, nothing works.
How the f can I build an android app if that shit is not working?
So… i finally did it… for other people…
- uninstall all javas
- instal normal java, then jdk (new one)
- restart computer
- download http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
- open android.bat with editor and change it to:
rem Change current directory and drive to where the script is, to avoid
rem issues with directories containing whitespaces.
cd /d %~dp0
rem Check we have a valid Java.exe in the path.
set java_exe=E:\Tools\JDK\bin\java.exe
set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
rem Set SWT.Jar path based on current architecture (x86 or x86_64)
for /f “delims=” %%a in (‘“%java_exe%” -jar lib\archquery.jar’) do set swt_path=lib%%a
Bold text is only changed, i just showed how it looks after the change (ofc u must paste your own dir to java.exe)
- save and start android.bat with admin
- consider it done