Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assets destination folder is not set Skipping react native (Images not loading in the APK)

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.

like image 438
Madhur Avatar asked Jun 28 '18 09:06

Madhur


2 Answers

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

like image 64
Kishan Gujarati Avatar answered Nov 12 '22 09:11

Kishan Gujarati


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.

like image 25
Sandy..... Avatar answered Nov 12 '22 08:11

Sandy.....