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\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "766da47c" install -r -d "C:\Users\eliag\OneDrive\Desktop\Programming\Unity\Projects\Family Finder\build.apk"
stderr[
adb: failed to install C:\Users\eliag\OneDrive\Desktop\Programming\Unity\Projects\Family Finder\build.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl1521964103.tmp/base.apk: Failed to collect certificates from /data/app/vmdl1521964103.tmp/base.apk using APK Signature Scheme v2: integer overflow]
]
stdout[
Performing Streamed Install
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.Command WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidDevice.Exec (System.String[] command, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidDevice.Install (System.String apkfile) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension <>c__DisplayClass17_0.<UploadAPK>b__0 () (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.AndroidDevice device, UnityEditor.Android.AndroidDeploymentTargetsExtension LaunchProgressTaskManager taskManager) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension <>c__DisplayClass13_1.<LaunchBuildOnTarget>b__2 () (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.ProgressTaskManager.Run () (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.PostprocessBuildPlayer <>c__DisplayClass22_1.<LaunchOnTargets>b__1 () (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.ProgressTaskManager.Run () (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.PostprocessBuildPlayer.LaunchOnTargets (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, UnityEditor.Build.Reporting.BuildReport buildReport, System.Collections.Generic.List`1[T] launchTargets) (at <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.Android.PostProcessAndroidPlayer.Launch (UnityEditor.BuildTarget target, System.String installPath, UnityEditor.Build.Reporting.BuildReport report) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)
UnityEditor.Android.AndroidBuildPostprocessor.LaunchPlayer (UnityEditor.Modules.BuildLaunchPlayerArgs args) (at <0bc7e9c04c1540528b26863a0cb726ae>: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 <44a70d1b13cf47e29810e30f45ffae08>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
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\2021.3.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe -s "766da47c" install -r -d "C:\Users\eliag\OneDrive\Desktop\Programming\Unity\Projects\Family Finder\build.apk"
stderr[
adb: failed to install C:\Users\eliag\OneDrive\Desktop\Programming\Unity\Projects\Family Finder\build.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl1521964103.tmp/base.apk: Failed to collect certificates from /data/app/vmdl1521964103.tmp/base.apk using APK Signature Scheme v2: integer overflow]
]
stdout[
Performing Streamed Install
]
exit code: 1
These two errors are thrown when the build process finishes. They are suucceded by this:
Build completed with a result of 'Succeeded' in 255 seconds (254854 ms)
0x00007ff7e47d930d (Unity) StackWalker::GetCurrentCallstack
0x00007ff7e47dffe9 (Unity) StackWalker::ShowCallstack
0x00007ff7e574d613 (Unity) GetStacktrace
0x00007ff7e5de223d (Unity) DebugStringToFile
0x00007ff7e39447e2 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000017017fcab0a (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000017017fca97b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000017017fc9dfe (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000170386c814d (Mono JIT Code) UnityEngine.Debug:Log (object)
0x0000017017e4aefb (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x0000017017e416db (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000017017e40cbb (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool)
0x0000017017e3beb3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
0x0000016d518c1f15 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
0x00007ffb051be4b4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
0x00007ffb050fe764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
0x00007ffb050fe8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
0x00007ff7e46f491e (Unity) CallStaticMonoMethod
0x00007ff7e46f46b6 (Unity) CallStaticMonoMethod
0x00007ff7e541a41f (Unity) BuildPlayerWithLastSettings
0x00007ff7e513bc30 (Unity) MenuController::ExecuteMenuItem
0x00007ff7e57547c6 (Unity) ProcessMainWindowMessages
0x00007ff7e57750ac (Unity) ContainerWindow::ContainerWndProc
0x00007ffbd7121c4c (USER32) CallWindowProcW
0x00007ffbd7120ea6 (USER32) DispatchMessageW
0x00007ff7e5753633 (Unity) MainMessageLoop
0x00007ff7e575805b (Unity) WinMain
0x00007ff7e6adb42e (Unity) __scrt_common_main_seh
0x00007ffbd6e154e0 (KERNEL32) BaseThreadInitThunk
0x00007ffbd7f2485b (ntdll) RtlUserThreadStart
On the phone, no app is installed. I've already tried building this project in the past, successfully.
After reading every answer I found online, I tried removing the old apk from my phone (and the Unity Remote 5 app as well) as well as from my PC, restarted both the phone and the PC, updated Windows, made sure that in my phone's developer mode settings both USB debugging and "install via USB" were on and "verify apps over USB" was off. I've even made a brand new project with a different name and copied the assets folder but upon building the same errors appeared. I've tried downloading android studio and manually setting the Android SDK file but couldn't get past the errors that showed up. I have no clue what could be causing this since just yesterday building and updating the project worked perfectly.
Update: I've tried changing the Unity editor version to the latest LTS, with no difference. I've also tried building to another android phone where there wasn't a previous installation but it still gave the same errors. This must mean the problem is with the Android SDK but I don't understand how that could cause any issues since it's the one installed directly with the unity installation.
CodePudding user response:
After making a brand new project and remaking every gameobject in the scene, and copying the scripts, it acqually worked. I still don't understand the cause of this issue (it might have to do with some files in the resources folder)