-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unable to load script from assets 'index.android.bundle'..." #269
Comments
The name in the "package.json" is wrong. Change it into: "name": "example" |
Do this For the first Time in your project root folder Step 2:
Step 3 : From next time on wards, need to follow the Step 2 in order to update the bundle before you run on device. |
same error give me solution ? |
just edit "package.json" file, and add this code |
I don't think this is lottie specific. |
I think it is related to this module. App was working fine and installed this module following the specified instructions and now app crashes on android. No failures on building and installing the apk, but crash on app load. Running |
If anyone gets any errors on running |
you just install app-release.apk and it's work |
En linux ejecutar estas linea solucionado sudo sysctl -w fs.inotify.max_user_instances=1024 |
I was able to resolve this error by firstt disabling my LAN setings from proxy then running the app. |
@morfsys .... this is perfect thanks(in step one, one has to swap the directories main and src; src first then main) |
@Kevin-Ogechi , right. Thank you for pointing out. |
Thank you @morfsys this worked perfectly! |
@morfsys you are a lifesaver. Kudos.. |
I was also facing same issue but after upgrading buildToolsVersion = "25.0.3" to buildToolsVersion = "27.0.3" it's working now . So many time I face the issue just because of buildToolsVersion If I haven't got any proper solution I just start playing with buildToolsVersion and after some time it works fine. |
in android manifest (/android/app/src/main/AndroidManifest.xml) there must be permission for internet (if you had deleted it) . it worked for me
|
From your root project directory do When I do this, I get " '.' is not recognized as an internal or external command, operable program or batch file" Please advise. |
@LucasShaffer you can try |
For window user only:- 4> now re start cmd and js server and run your react native project by "react-native run-android" |
Thanks a lot @morfsys. |
worked for me too |
This error showing due to the missing of below files in project 1)Select project folder in command prompt. Then debug app normally.. |
How is it a solution if you have to manually run a command each time? It's just a workaround... a real solution would be making react-native's build script/whatever generate this bundle file automatically when running on Android, like it does for iOS presumably (for iOS I don't have to run any additional commands). Update: I found a way to automatically run the bundle script: add this to your app/build.grandle:
Apparently the But this is still not a solution... ideally the app should connect to the packager server running on localhost, but for at least it doesn't do that, sadly I haven't figured out why 😞 Final update: For some reason I had
React Native was always trying to load index.android.bundle from the app pacakge, not from the dev server. Removing the |
To resolve Unable to load script from assets index.android.bundle - React Native follow below process : You have to create dir assets manually in your android project or make Directory by Terminal/CMD enter Go at the created Directory if that is successfully created then run step 3 Command:
|
enable wifi on emulator devices . it's work for me |
seems stupid but, It works for me |
I was running into the same error when trying to build a release version on a device. I was running react native 0.57.1 and was able to fix my issue by changing the gradle version. More info here facebook/react-native#23739 (comment). Hopefully, the fix I used can fix someone else's build also 😄 |
For those that are running into this on Android 9 specifically (and don't want any dirty workarounds..), this was fixed in RN59 and requires additional network config to be added to your project. To solve, add the following files to the
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"
android:networkSecurityConfig="@xml/react_native_config" />
</manifest> |
@IjzerenHein that's the correct thing to do... while I was updating I probably didn't created that files... |
http://www.learnandroidcodeonline.com/Blogs/blogs_listing/unable-to-load-script.html |
The network config referred to here is no longer there since 0.59.2 |
thanks. |
When you install the NodeJS using the choco command(choco install -y nodejs.install python2 jdk8), it will install the latest version of node which is 12.12.0 at the time of writing this answer. You have to downgrade it to 10.16.3 and run the react-native run-android command and it should work fine |
worked for me. |
God, I can't believe I've stuck at this for hours. Enable Wifi fixes the problem. |
@sryze even two years later your solution still saved my day! This was the missing hint:
I had a working |
Very thank you, Safe my life, it is worked for me |
What if one wants to debug staging? How should I make it work like debug? |
if you'r using proguard add an exception to android/app/proguard-rules.pro: -keep class com.mypackage.BuildConfig { *; } com.mypackage should match the package value in your app/src/main/AndroidManifest.xml file. |
seem stupid but it works for me |
Ciao, Affected Versions
The common error
In short, index.android.bundle is missing The problem The solution I hope this will help. |
When I follow the instructions here for Android, I immediately receive the error "unable to load script from assets 'index.android.bundle' as shown in the screenshot. I have refreshed my project and followed the instructions closely several times. My project runs fine until I try to link Lottie. Any idea why I am getting this error?
The text was updated successfully, but these errors were encountered: