发布APK未使用JavaScript代码更新 [英] Release APK Not Updating With JavaScript Code
问题描述
当我生成第一个签名的APK时,我的Android APK正在JavaScript
上运行.我试过在Android Studio中清理/重建项目,试过android
子文件夹中的./gradlew clean
.关于为什么代码没有更新的任何想法?我见过此问题,但对我而言没有任何成功.
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
这篇关于发布APK未使用JavaScript代码更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!