Manually installing an updated APK fails with “signatures do not match the previously installed version”

前端 未结 7 1422
悲&欢浪女
悲&欢浪女 2020-12-04 23:01

I\'ve built a silly app to share among a few friends. No need to put it up on the app-store.

I built the first apk (signed), uploaded it to a web-server

相关标签:
7条回答
  • 2020-12-04 23:31

    For Unity users who come to this question, the best answer is indeed the one above by @Ehsan

    adb uninstall "com.yourapp.yourapp"
    

    I had already installed a previous version on my Android device then selected Development Build in Unity > Build Settings which caused the APK to use a different signature. If you install through the Android GUI it doesn't actually remove everything so you have to use ADB.

    0 讨论(0)
  • 2020-12-04 23:33

    If you are seeing this while conducting connected tests, make sure to include .test when uninstalling via adb because uninstalling via app -> settings does not get rid of the test package

    adb uninstall your.broken.package.test
    

    if you just uninstall via

    adb uninstall your.broken.package
    

    your test package will still be there. This was only something i noticed while using the gradle command line, haven't come across this problem within android studio

    0 讨论(0)
  • 2020-12-04 23:40

    I had the same issue and the adb uninstall solution did not work for me.

    What worked was

    • On your device go to to Settings->Apps
    • Select your app, and in the menu select "Uninstall for all users"

    Even if I had previously uninstalled the app it was still in the list there.

    0 讨论(0)
  • 2020-12-04 23:42

    To me, if the app is meant to be distributed, the adb solution is a no-go: you can't ask one's friend to have the android sdk installed on their machine !

    The way to go here is to edit the AndroidManifest.xml and to increment the android:versionCodeattribute in the <manifest>tag (which is the root element).

    This would update your installed application

    0 讨论(0)
  • 2020-12-04 23:43

    Uninstall the old app from your phone or emulator and try to run again.

    0 讨论(0)
  • 2020-12-04 23:43

    I got that error while trying to install release while signing it's certificate.

    fixed with the :app Gradle task uninstallRelease and then installRelease again

    0 讨论(0)
提交回复
热议问题