- Home /
CommandInvokationFailure Unable to install APK to device.Please make sure the Android SDK is installed and is properly configured in the Editor.
CommandInvokationFailure: Unable to install APK to device.Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. C:\Program Files\Unity\Hub\Editor\2020.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "7e5dcaba" install -r -d "C:\Users\hledw\Videos\slimeOCUI\share.apk"Isit i need to download new JDK and andriod studio?
you are not sharing the error details so is hard to tell, but you could start by using recommended sdk and jdk included with unity
Answer by hledward7 · Mar 26, 2021 at 12:53 AM
problem solved... maybe the MIUI on xiaomi phone block ...Developer mode >>turn off "Turn on MIUI optimization"
Answer by hledward7 · Mar 26, 2021 at 09:10 PM
i using unity recommended sdk and jdk included with unity still have the same error
1)CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. C:\Program Files\Unity\Hub\Editor\2020.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "7e5dcaba" install -r -d "C:\Users\hledw\Videos\slimeOCUI\SlimeOC..apk"
stderr[ adb: failed to install C:\Users\hledw\Videos\slimeOCUI\SlimeOC..apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user] ] stdout[
] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0) UnityEditor.Android.AndroidDevice.Exec (System.String[] command, System.String errorMsg) (at :0) UnityEditor.Android.AndroidDevice.Install (System.String apkfile) (at :0) UnityEditor.Android.AndroidDeploymentTargetsExtension+<>c_DisplayClass16_0.b0 () (at :0) UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension+LaunchProgressTaskManager taskManager) (at :0) UnityEditor.Android.AndroidDeploymentTargetsExtension+<>cDisplayClass12_1.b2 () (at :0) UnityEditor.ProgressTaskManager.Run () (at :0) UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at :0) UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at :0) UnityEditor.PostprocessBuildPlayer+<>cDisplayClass19_1.b_1 () (at :0) UnityEditor.ProgressTaskManager.Run () (at :0) UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at :0) UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at :0) UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at :0) UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at :0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
2) CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. C:\Program Files\Unity\Hub\Editor\2020.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "7e5dcaba" install -r -d "C:\Users\hledw\Videos\slimeOCUI\SlimeOC..apk"
stderr[ adb: failed to install C:\Users\hledw\Videos\slimeOCUI\SlimeOC..apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user] ] stdout[
] exit code: 1