13

I am using this command :

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

Output
Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (86ms) Scanning folders for symlinks in C:\Users\mgaba\Desktop\InfraGBU\node_modules (94ms) Loading dependency graph, done. bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle bundle: Done writing bundle output **Assets destination folder is not set, skipping...**

Due to this i will not able to see images in apk. Images is not loading with this please help to remove this error.

0

2 Answers 2

36

Try This it worked for me

for android

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/

EDIT

for ios

react-native bundle --entry-file ./index.js --platform ios --bundle-output ios/main.jsbundle --assets-dest ios

Thank you @kalpa

7
  • I am getting the same error for iOS, Can you guide me what will be the command?
    – kalpa
    Commented Sep 27, 2019 at 10:23
  • 4
    For iOS : react-native bundle --entry-file ./index.js --platform ios --bundle-output ios/main.jsbundle --assets-dest ios
    – kalpa
    Commented Sep 27, 2019 at 10:44
  • 1
    yes you are right @kalpa i forgot to write about ios i'll edit answer thank you Commented Nov 29, 2019 at 5:23
  • This only works sometimes.....I keep ending up with a cached (old) version of my project when I build a release build. Why?
    – Jo Momma
    Commented May 14, 2020 at 13:23
  • How to undo this?
    – sanister
    Commented Dec 1, 2021 at 5:59
3

In your project directory, open terminal/command prompt and try below commands:

react-native bundle --assets-dest ./android/app/src/main/res/ --entry-file ./index.android.js --bundle-output ./android/app/src/main/assets/index.android.bundle --platform android --dev false

Then follow below commands:

cd android
./gradlew installRelease or ./gradlew assemblerelease

Please note that, if you have "index.android.js" file then use above commands as it is else replace it with "index.js" and use above commands.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.