Skip to content
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 make sure you are either running a metro server or that your bundle "index.android.bundle" is packaged correctly for release #25348

Closed
anandnidgundi opened this issue Jun 21, 2019 · 10 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@anandnidgundi
Copy link

This error coming after generating release apk, Please Help
react-native-error

@react-native-bot react-native-bot added Platform: Android Android applications. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. labels Jun 21, 2019
@react-native-bot
Copy link
Collaborator

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

👉 Click here if you want to report a reproducible bug or regression in React Native.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: No Template labels Jun 21, 2019
@nahcnats
Copy link

what the fuck is this? i had to run the following command to make it work for a bare bone app 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

hopefully i remember if i ever pull it from my git. this is fucking stupid. no docs whatsoever about the update to gradle 5 > above. all my dependencies don't work. my app just go kaput? plus stupid google play forces u to go to API28, anything less, they'll reply something like 'fuck off'.

@ivanfranchi
Copy link

android:usesCleartextTraffic="true" following
THIS https://stackoverflow.com/questions/55441230/unable-to-load-script-make-sure-you-are-either-running-a-metro-server-or-that-yo
and THIS https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted/50834600#50834600
did the job (was having the same error)

@imAliAzhar
Copy link

imAliAzhar commented Sep 13, 2019

To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

On Arch Linux, the files mentioned in step 3 and 4 may not exactly have the same name (e.g. metro-cache or haste-map-metro). To make sure you delete the temp files, navigate to /tmp directory and delete anything with metro or haste in it, yourself.

@dipo1
Copy link

dipo1 commented Feb 24, 2020

In my case, the emulator was on airplane mode.
Make sure your emulator or mobile phone can communicate with the Metro server.

@YahiaJabeur
Copy link

I m facing again this issue when I upgraded to react native 0.62.0
Any idea how to resolve it ?

@Taynan-Vieira
Copy link

Pessoal, essa solução funcionou para mim:

Não foi possível carregar o script dos ativos 'index.android.bundle'. Certifique-se de que ...
Esse erro geralmente ocorre porque o sistema não conseguiu criar o pacote inicial que contém todo o código Javascript da aplicação.

1- Para resolver, comece a criar uma pasta de ativos dentro da pasta android / app / src / main.

2- Logo após, execute o comando:

npx react-native bundle --plataforma android --dev false --entry-file index.js - android-app de saída de pacotes / app / src / main / assets / index.android.bundle --assets-dest android / app / src / main / res /

3- Agora, feche o terminal e execute novamente o comando:

npx react-nativo run-android
ou fio executar react -nativo run-android
ou fio android

Fonte: https://react-native.rocketseat.dev/erros/android/

@Roham0010
Copy link

I had same error, with a wipe data for emulator on AVD problem solved

@TalitaLira
Copy link

In my case, the emulator was on airplane mode.
Make sure your emulator or mobile phone can communicate with the Metro server.

Man, so simple! Mine had the network disconnected... Thanks a lot!

@alexeystrakh
Copy link

what the fuck is this? i had to run the following command to make it work for a bare bone app 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

hopefully i remember if i ever pull it from my git. this is fucking stupid. no docs whatsoever about the update to gradle 5 > above. all my dependencies don't work. my app just go kaput? plus stupid google play forces u to go to API28, anything less, they'll reply something like 'fuck off'.

And even this won't work if you manually do not create the assets subfolder in the android/app/src/main folder. Thanks for the command!

@facebook facebook locked as resolved and limited conversation to collaborators Jun 21, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests