react-native run-android builds an old version of

2020-05-20 08:05发布

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.

Step-by-step of what I have tried:

  1. Modify code.

  2. Re-bundle:

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

  1. ./gradlew clean

  2. react-native run-android - Builds old version

  3. react-native run-android --variant=release - Builds old version

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.

1条回答
疯言疯语
2楼-- · 2020-05-20 08:26
  1. Delete files inside directory android/app/src/main/assets.
  2. run $ 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
  3. $ react-native run-android
查看更多
登录 后发表回答