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.
- (in project directory)
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
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.
- (in project directory)
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
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.
- (in project directory)
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
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
How to Restart Activity in Android
Can an Android Toast Be Longer Than Toast.Length_Long
"Android.View.Windowmanager$Badtokenexception: Unable to Add Window" on Buider.Show()
What Does @Hide Mean in the Android Source Code
Building and Running App Via Gradle and Android Studio Is Slower Than Via Eclipse
How to Create a Release Signed Apk File Using Gradle
How to Add the New "Floating Action Button" Between Two Widgets/Layouts
Height of Status Bar in Android
Android: Show Soft Keyboard Automatically When Focus Is on an Edittext
Install/Uninstall Apks Programmatically (Packagemanager VS Intents)
How to Check the Current Status of the Gps Receiver
Android Gradle Plugin 0.7.0: "Duplicate Files During Packaging of Apk"
Determining the Size of an Android View At Runtime
What Is the Android Uithread (Ui Thread)
"Failed to Load Ad: 3" With Doubleclick