White screen with React-Native

Asked

Viewed 1,609 times

0

I am initiating a project with React-Native , but after giving the following commands:

react-native init projectName
react-native run-android

I come across not with the React-Turn on boot screen in the emulator (Genymotion) or on mobile via USB, but with a totally white screen, without any information or any error charged. It does not change in any way, nor with project Load, or change in the source code. Has anyone ever been in this situation or knows how to help me?

The version of React-Native-cli : 2.0.1

  • If the metro bundler did not start with the run-android command, start it with the command npm start or yarn start. Close the app and open again from the mobile, should solve.

  • You’ve done this over and over and it doesn’t solve anything,

3 answers

3


To solve start by creating a folder Assets inside the briefcase android/app/src/main.

Soon after, execute the command:

$ 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/

Now, close the terminal tabs and run React-Native run-android again.

Docs Rocketseat

0

This happens to me a lot, what I do (simplest thing in the world) does not need to run any code.

  1. Go to Phone Settings
  2. Go to apps and open your app’s settings screen
  3. Tap Storage and clear the data (ALL)
  4. Open app again, the Metro Bundler will recharge and will appear all

0

Remove the folder node_modules and then reinstall it by typing the following commands:

yarn install

or

npm install

then run your project again with the command react-native run-android for example.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.