Getting error while building a project for android

hey i am trying to build an android apk with unity . i have both java(in c or system drive)and android sdk(in an other drive)downloaded and installed. the error that is raised is:-

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:\Program Files (x86)\Java\jdk1.8.0\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir=“E:/files/android sdk ools” -Dfile.encoding=UTF8 -jar “E:/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar” -

stderr[
Error:Invalid command android
]
stdout[

please help!

@ mihirtheboss its too late but still for others who need help
Got the same issue, answer is given in the following thread…

mine solved perfectly, also don’t forget to copy zip align from one of the build tools(Android/sdk/buildtools) to the tools(Android/sdk/tools) folder, though newer versions might work without it, but still…!

hope this helps…!!

I know this error from architecture mismatches. Make sure you have Java 32 bit installed, not 64 bit.