Need help when i am trying to build my unity project its giving below error. But i could not rectify error due to same. Any help will be useful.
Error 1
Error: Failed to add D:\jbINTEG\Temp\StagingArea\bin\classes.dex
UnityEditor.HostView:OnGUI()
Error 2
CommandInvokationFailure: Failed to build apk. See the Console for details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error: Failed to add D:\jbINTEG\Temp\StagingArea\bin\classes.dex
]
stdout[
]
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.HostView:OnGUI()
Error 3
Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error: Failed to add D:\jbINTEG\Temp\StagingArea\bin\classes.dex
]
stdout[
]
Thank you all for thinking over to my question.
Got it working. Actually found issue. Its related to antivirus in my machine. When i tried over building it for android platform. Kaspersky Antivrus was terminating packaging of apk via aapt tool. So at the end above issue was coming over again and again.
As soon as i paused antivirus protection and rebuild unity project. Everything started working fine without any issue.