How to Load Script from Assets Index.Android.Bundle on Windows

Unable to load script from assets index.android.bundle on windows

I've encountered the same issue while following the React Native tutorial (developing on Linux and targeting Android).

This issue helped me resolve the problem in following steps.

  1. (in project directory) mkdir android/app/src/main/assets
  2. 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

You can automate the above steps by placing them in scripts part of package.json like this:

"android-linux": "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 && react-native run-android"

Then you can just execute npm run android-linux from your command line every time.

Unable to load script from assets 'index.android.bundle'. Make sure...

I got solution for this after:

Replace the code with this one. The path of the file is -

node_modules\metro-config\src\defaults\blacklist.js

var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];

Link from Stack Overflow here

And also running the following commands in the root project folder:

npm i -g jetifier
npx jetify

Link here from GitHub

I hope it helps someone.

tks to the community.

Unable to load script from assets index.android.bundle on windows

I've encountered the same issue while following the React Native tutorial (developing on Linux and targeting Android).

This issue helped me resolve the problem in following steps.

  1. (in project directory) mkdir android/app/src/main/assets
  2. 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

You can automate the above steps by placing them in scripts part of package.json like this:

"android-linux": "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 && react-native run-android"

Then you can just execute npm run android-linux from your command line every time.

Unable to load script from assets index.android.bundle on windows

I've encountered the same issue while following the React Native tutorial (developing on Linux and targeting Android).

This issue helped me resolve the problem in following steps.

  1. (in project directory) mkdir android/app/src/main/assets
  2. 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

You can automate the above steps by placing them in scripts part of package.json like this:

"android-linux": "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 && react-native run-android"

Then you can just execute npm run android-linux from your command line every time.

Unable to load script from assets 'index.android.bundle'.

Here are the steps i need you to follow to solve this issue.

Delete android folder and do react-native upgrade (not react-native run-android)

create the folder in the following location.

your_app/android/app/src/main

Perform the following command in root directory. (simply copy and paste the below code)

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/

Please note if you are using index.android.js then replace it in --entry-file.

and lastly

cd android && ./gradlew installDebug

Hope this solves your solution.

index.android.bundle not updating when creating release build

Follow the procedure first time.

mkdir android/app/src/main/assets

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


npm start -- --reset-cache

react-native run-android

if you want to take an apk file

cd android && ./gradlew clean

finally

./gradlew assembleRelease

Basically The below commands worked for me

cd android
./gradlew clean
./gradlew assembleRelease


Related Topics



Leave a reply



Submit