gpt4 book ai didi

Android - "Application not installed"- 无法使用新的 apk 更新 - React Native

转载 作者:行者123 更新时间:2023-11-29 02:36:27 26 4
gpt4 key购买 nike

我目前在 Play 商店中有 React Native 应用程序。一个月前完成的步骤:

    1. 我使用 keytool 生成了私有(private)签名 key
    2. 我生成了名为 prod.keystore 的 kestore(记住别名)
    3. 将我的 prod.keystore 放在 android/app 目录中
    4. 使用正确的 keystore 密码、别名和 key 编辑 ~/.gradle/gradle.properties
    5. 编辑文件 android/app/build.gradle 添加签名配置
    6. 运行 cd android && ./gradlew assembleRelease 获取 apk 成功将 apk 上传到 Play 商店

今天,在对我的代码进行一些更改后,我使用相同的 prod.keystore(具有相同的 keystore 密码、别名和 key )生成了新的 apk。在此之前,我在 Androidmanifest.xml 和 build.gradle 中增加了 android versionCode。

我有从 Playstore 安装的旧版本应用程序。生成新的 apk 后,我尝试将它安装到我的手机上。我预计更新会完成,但在尝试安装后,我收到消息“应用程序未安装”。adb install new-apk-name.apk 给我一些更详细的错误 INSTALL_FAILED_UPDATE_INCOMPATIBLE

我不想卸载应用程序并重新安装。我希望能够在上传到商店之前更新应用程序并对其进行测试。有人知道为什么这不起作用吗?

最佳答案

解决方案

  1. 卸载从 Play 商店下载的应用
  2. 安装新的 apk

仔细检查更新是否适用于用户

Use the following checklist to make sure your new APK is ready to update your existing users:

The package name of the updated APK needs to be the same as the current version. The version code needs to be greater than that current version. Learn more about versioning your applications. The updated APK needs to be signed with the same signature as the current version. To verify that your APK is using the same certification as the previous version, you can run the following command on both APKs and compare the results:

$ jarsigner -verify -verbose -certs my_application.apk

If the results are identical, you’re using the same key and are ready to continue. If the results are different, you will need to re-sign the APK with the correct key.

有关更多信息,请查看 Google 文档 here

关于Android - "Application not installed"- 无法使用新的 apk 更新 - React Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46740410/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com