shubham
shubham

Reputation: 1319

React-native application giving white screen while running the project for the first time

I have setup a react-native application by running react-native run-android and tried running it with react-native start. Packager gives no error but the app getting stuck on a white screen . I have tried it on my mobile device and on simulator as well but all ended up in failure. Also I have cross checked the host IP in device developer settings. When I tried running http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle in google chrome, I got {"type":"InternalError","message":"react-packager has encountered an internal error, please check your terminal error output for more details"} I have shell out lots of time into this but find nothing. There were some links related to white screen issue but those were some code issue related to external modules they were using, but mine is just a vanilla react native project with nothing being added.

React-native version 0.46.4 Platform macOS Sierra version 10.12.2

Have tried running gradle clean and also deleted the build folder before react-native run-android.

Any help will be appreciated, thanks in advance.

Upvotes: 1

Views: 1594

Answers (3)

Muaz
Muaz

Reputation: 142

It maybe because the package signatures don't match with the already installed version on your device. Uninstall and run again. It worked for me.

Upvotes: 1

shubham
shubham

Reputation: 1319

Getting this issue whenever I ran the application first time after installation. Just exit the application, clear it from RAM and open again. Hurray! the issue is resolved.

Upvotes: 0

Vipul Panth
Vipul Panth

Reputation: 5801

I also faced the same issue,And was able to solve this by changing my package.json file on my machine.

Update the script in package.json by changing node node_modules/react-native/local-cli/cli.js start to node_modules/react-native/scripts/packager.sh this will allow your android emulator to read the index.andriod.js file from your local machine.

Also use npm start to run the dev server.

I am not sure why this is causing this, but it can be read issue from the dev server from android emulator.

Thanks.

Upvotes: 2

Related Questions