Search Unity

Update APK on phone without removing the old version

Discussion in 'Android' started by ph4ntomz, Nov 4, 2018.

  1. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Unity Version: 2017.3.1f1

    Hi guys,

    I am currently running into a problem: Unity fails to install the APK on my Galaxy S7 with the following error message: "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."

    Previously, I have been testing my game on a Galaxy Alpha, which automatically updated the APK on the phone. In order to solve my problem, I have to remove the previously installed APK and then build the new APK, which is a little bit more work each time.

    Is there a way to update the installed APK on the S7 instead of removing the old APK each time?

    Best wishes
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Have you check Editor.log what is exactly the error?
     
  3. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Code (CSharp):
    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.
    2. C:/Users/Kjell Bunjes/AppData/Local/Android/Sdk\platform-tools\adb.exe -s "ce12160cf1d08f1701" install -r "D:\Entwicklung\OmegaPort\OmegaPort\test.apk"
    3.  
    4. stderr[
    5. adb: failed to install D:\Entwicklung\OmegaPort\OmegaPort\test.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.test.bunjes signatures do not match the previously installed version; ignoring!]
    6. ]
    7. stdout[
    8.  
    9. ]
    10. exit code: 1
    11. UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    12. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    13. UnityEditor.Android.ADB.RunInternal (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    14. UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    15. UnityEditor.Android.AndroidDevice.Exec (System.String[] command, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    16. UnityEditor.Android.AndroidDevice.Install (System.String apkfile, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
    17. UnityEditor.Android.AndroidDeploymentTargetsExtension+<UploadAPK>c__AnonStorey2.<>m__0 ()
    18. UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.BuildReporting.BuildReport buildReport, UnityEditor.Android.AndroidDevice device, UnityEditor.ProgressTaskManager taskManager)
    19. UnityEditor.Android.AndroidDeploymentTargetsExtension+<LaunchBuildOnTarget>c__AnonStorey1.<>m__0 ()
    20. UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
    21. UnityEditor.Android.AndroidDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.BuildReporting.BuildReport buildReport, DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler)
    22. UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (BuildTargetGroup targetGroup, UnityEditor.BuildReporting.BuildReport buildReport, DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at C:/buildslave/unity/build/Editor/Mono/DeploymentTargets/DeploymentTargetManager.cs:36)
    23. UnityEditor.PostprocessBuildPlayer+<Launch>c__AnonStorey0.<>m__1 () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:181)
    24. UnityEditor.ProgressTaskManager.Run () (at C:/buildslave/unity/build/Editor/Mono/Utils/ProgressBarUtils.cs:71)
    25. UnityEditor.PostprocessBuildPlayer.Launch (BuildTargetGroup targetGroup, BuildTarget buildTarget, System.String path, System.String productName, BuildOptions options, UnityEditor.BuildReporting.BuildReport buildReport) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:197)
    26. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    27.  
    So, the signatures are not matching. I have never changed them at any point in the project since the project setup, though.

    Best wishes
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Probably something has changed in AndroidManifest.xml or you sign with different keystore now.
     
  5. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Wouldn't that imply that once I've installed a new version (and removed the old version) on my S7 device results in the error not occuring any longer and Unity being able to update it properly? I'm asking, because this is not the case. I have to manually de-install my app from my S7 every time before I can build again while it works on other devices just fine without de-installing.

    Best wishes
     
  6. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Do you sign with a debug key or do you provide your own key to sign the app? Does this happen with a new / empty project or only with that one project?
     
  7. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Yes, I am using a debug key. No, this does not happen with an empty project, only with my current project.

    Best wishes
     
  8. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Jumping in on this thread, just to clarify - updating ALWAYS FAILS?

    For example, when running the following steps, step #3 fails ?

    1. Start from a clean state (game is not installed)
    2. Build and run from Unity.
    3. After game runs, build and run again.
     
  9. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Exactly. This behaviour does not occur when I'm using my Galxy S Alpha or S5.
     
  10. ph4ntomz

    ph4ntomz

    Joined:
    Jul 22, 2016
    Posts:
    37
    Update: Today I installed the latest update on the Galaxy S7 and this solved the issue.