发布不使用 JavaScript 代码更新的 APK [英] Release APK Not Updating With JavaScript Code

查看:18
本文介绍了发布不使用 JavaScript 代码更新的 APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我生成第一个签名的 APK 时,我的 Android APK 正在运行 JavaScript.我试过在 Android Studio 中清理/重建项目,我试过 ./gradlew cleanandroid 子文件夹中.关于为什么代码没有更新的任何想法?我见过这个问题,但我自己没有成功.

My Android APK is running off the JavaScript present when I generated the first signed APK. I've tried cleaning/rebuilding the project in Android Studio, I've tried ./gradlew clean in the android subfolder. Any ideas as to why the code isn't updating? I've seen this issue, without any success for myself.

推荐答案

我删除了 android/app/src/main/assets/ 中的 index.android.* 文件> 目录.然后在项目根目录下,运行

I deleted the index.android.* files in android/app/src/main/assets/ directory. Then in the project root, ran

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

然后我重新生成了已签名的 APK,瞧!

Then I regenerated the signed APK and voila!

如果您使用较新的项目,您可能没有 index.android.js 只有 index.js.如果是这种情况,您需要将其更改为:

If you are using a newer project, you may not have an index.android.js only index.js. If that's the case, you'll want to change it to:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

这篇关于发布不使用 JavaScript 代码更新的 APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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