Unity GooglePlay Service Error while building

Hello,

We have implemented the googleplay services to our project and after that when we are trying to build our project it gives a error like this.

Note that; SDK and JDK are updated, their paths are correct in the unity and we have added the envoirement variable path as JAVA_HOME.

CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.7.0_80\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/EMClaptop02/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]
exit code: 64
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
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/Java/jdk1.7.0_80\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/EMClaptop02/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
Error:Invalid command android
]
stdout[

]
exit code: 64

This is not problem of Google Play Service, this problem is about Android SDK: in the latest version was deleted the android command so Unity can’t build APK.

Here is a well explained solution: [Solved] Android command deprecated, error: Unable to list target platforms - Unity Engine - Unity Discussions

1 Like

thank you , i fixed my problem