1日1%成長するブログ

毎日成長するために仕事/プライベートで得た学びをアウトプットするブログです

ReactNativeの実機ビルドでunable to load script from assets index.android.bundleになる時の対処

以下手順でOK

mkdir android/app/src/main/assets

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

再ビルド実行

[Android] Building release APK with react-native bundle · Issue #2743 · facebook/react-native https://github.com/facebook/react-native/issues/2743

リリース用のAPKの時にJSファイルをbundleしてくれないgradleの不具合? 今の所、自分でbundleコマンドを実行しないといけないみたい。

自分の場合はこれで動きました。