Search code examples
react-nativereact-native-cli

React native bundle command hangs at copying assets


I am trying to run a react-native bundle for Android using react native cli. It hangs after trying to copy assets to the "res" folder. I am running it on Windows 10.

Here is the console output:

C:\..\ReactNative>react-native bundle --platform android --dev true --entry-file index.android.js --bundle-output ".\android
\src\main\assets\index.android.bundle" --assets-dest ".\android\src\main\res\"

[01/14/2017, 08:13:44] <START> Initializing Packager
[01/14/2017, 08:13:47] <START> Building Haste Map
[01/14/2017, 08:13:48] <END>   Building Haste Map (810ms)
[01/14/2017, 08:13:48] <END>   Initializing Packager (4287ms)
[01/14/2017, 08:13:48] <START> Transforming files
[01/14/2017, 08:14:02] <END>   Transforming files (14205ms)
bundle: start
bundle: finish
bundle: Writing bundle output to: .\android\src\main\assets\index.android.bundle
bundle: Done writing bundle output
bundle: Copying 5 asset files

Based on what I see in the source file, it should resolve a promise after completing the step. It worked previously, but then out of a sudden stopped working.

Does anyone have any suggestions what could be an issue?

Thanks!


Solution

  • The issue was simple - I had an incorrect path to the destination folder. In order to solve the problem I added logging to the bundle.js file in the react native CLI and just watched the console output to tell me what was wrong.