react-native run-android 在设备上构建旧版本的代码 [英] react-native run-android builds an old version of the code onto device
问题描述
这发生在生产和开发版本中.我可以连接到开发服务器,重新加载,并且新代码在设备上构建并运行.
This occurs in both production and dev builds. I can connect to the dev server, reload, and the new code is built and runs on the device.
我尝试过的分步说明:
修改代码.
Modify code.
重新捆绑:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-目标 android/app/src/main/res
./gradlew clean
react-native run-android
- 构建旧版本
react-native run-android --variant=release
- 构建旧版本
有什么办法可以彻底清除 android
构建并从头开始构建?我的直觉告诉我 run-android
没有执行完全干净的构建.
Is there any way to completely wipe the android
build and build from scratch? My gut tells me that run-android
is not performing a full clean build.
推荐答案
- 删除目录 android/app/src/main/assets 中的文件.
- run
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --资产目标 android/app/src/main/res
$ react-native run-android
这篇关于react-native run-android 在设备上构建旧版本的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!