android-wear 在移动版本的 apk 中嵌入旧的(缓存的)wear apk [英] android-wear embedding old (cached) wear apk in the mobile-release apk

查看:34
本文介绍了android-wear 在移动版本的 apk 中嵌入旧的(缓存的)wear apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用选项 Build -> Generate Signed APK 生成签名的 apk

I am generating the signed apk using the option Build -> Generate Signed APK

问题是 mobile-release.apk 没有嵌入更新的 Wear apk.我试过改变文本/逻辑,但它总是显示旧的东西.

Problem is mobile-release.apk doesn't embed the updated wear apk. I have tried changing text / logic, but it always display the old thing.

我已经尝试了以下所有方法,任何想法为什么它一直嵌入旧磨损 apk 而不是创建新的.

I have tried all of the following, any ideas why it keep embedding the old wear apk instead of creating the new one.

  • 文件 -> 使缓存无效/重新启动.
  • 构建 -> 清理 + 重建项目
  • 清除手机上 Wear 应用的缓存
  • 设置 -> 重新同步所有应用(手持穿戴应用上的选项)
  • 手动删除 mobile 和 Wear mobile 的 build 文件夹中的所有 apk.

任何提示,或任何面临类似问题的人,请回复.

Any hints, or anybody facing similar issue, please reply.

更新 1:

我单独测试了生成的 wear-release.apk,它是最新的,但不知何故嵌入的 apk 还是旧的.

I tested the generated wear-release.apk separately, its the latest, still somehow the embedded apk is old.

我将我的 gradle 配置更改为手动包含新生成的 apk,

I changed my gradle config to manually include newly generated apk,

compile fileTree(dir: 'libs', include: ['*.jar'])
// wearApp project(':wear')
wearApp files('wear-release11.apk') // renamed purposefully to make sure its picking right file.

如果 wear-release11.apk 丢失,它确实会出错......但是当 wear-release11.apk 可用时,它仍然嵌入了一些旧的缓存的 apk.

it indeed give error if wear-release11.apk is missing.. but when the wear-release11.apk is available, it still embed some old cached apk.

更新 2:我提取并查看了生成的APK的内容,里面确实有最新生成的apk.但不知何故,手机推送缓存版本.不确定它的android-wear"配套应用程序还是 Play Store 应用程序导致了这个错误.对我来说,卸载 android-wear 配套应用程序(令人惊讶的是,不仅仅是清除数据)解决了这个问题.但它会在一段时间后再次缓存 apk.

Update 2: I extracted and inspected the contents of generated APK, it indeed has the latest generated apk inside it. But somehow, the phone push cached version. Not sure if its 'android-wear' companion app or the Play Store app causing this bug. For me uninstalling the android-wear companion app (surprisingly, not just clearing data) solve this issue. But it will cache the apk again after some time.

推荐答案

我不久前看到过一种情况,可穿戴应用程序卡住并且无法更新.我认为这个错误已经解决,但我想把这个答案记录下来,以防它仍然发生.

I have seen a situation a while ago where the wearable app would get stuck and would not update. I think the bug has been resolved, but I wanted to put this answer down for the record just in case it is still happening.

如果您 100% 确定您的 APK 版本正确,那么您可以尝试这个程序,它应该总是可以修复它.如果这不能解决问题,则说明您的 APK 构建过程存在问题:

If you are 100% sure your APK is versioned properly, then you can try this procedure which should always fix it up. If this does not fix it, then there is a problem with your APK build process:

  1. 将手表恢复出厂设置:设置...重置设备
  2. 在您的手机上:设置 ... 应用 ... Google Play 服务
  3. 点击清除缓存
  4. 点击管理空间
  5. 管理可穿戴存储...立即清除
  6. 在 Google Play 服务使用的总数据下......清除所有数据
  7. 重启手机
  8. 尝试再次将手机与手表配对

这篇关于android-wear 在移动版本的 apk 中嵌入旧的(缓存的)wear apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆