Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native app stuck on blank screen when running on device with remote debugging

Tags:

react-native

I run my react native application on my device (iPhone 6) and it loads fine. But when I enable remote debugging, it seems to connect fine to debugger but gets stuck on a blank screen.

As soon as I turn off remote debugging, everything loads fine.

I am on react-native 0.40.0.

Please help!

like image 922
tristanbbq Avatar asked Jan 26 '17 21:01

tristanbbq


People also ask

How do I debug React Native on a device?

Debugging on a device with Chrome Developer Tools If you're using Create React Native App or Expo CLI, this is configured for you already. On iOS devices, open the file RCTWebSocketExecutor.m and change "localhost" to the IP address of your computer, then select "Debug JS Remotely" from the Developer Menu.

How do I run React Native projects on Android?

Plug in your device via USB # Let's now set up an Android device to run our React Native projects. Go ahead and plug in your device via USB to your development machine. Now check that your device is properly connecting to ADB, the Android Debug Bridge, by running adb devices.

How do I get console logs from the React Native bundler?

If you're using Create React Native App or Expo CLI, console logs already appear in the same terminal output as the bundler. If you're using Create React Native App or Expo CLI, this is configured for you already.

Do I need root access for react developer tools?

Root access is required for the use in real device. Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read this section to learn how.


1 Answers

There can be many reasons, in my case it was the cache that was creating problem. Suggested Solutions:-

  1. Clean gradlew - To clean gradle go to android folder and open cmd in it, run 'gradlew clean' in the cmd
  2. after cleaning gradle, re-build your app run command (run-android etc)
  3. if the problem exist after rebuilding follow step 4 & 5
  4. Go to App's setting and clear App's data
  5. now clear react-native terminal's cache ( react-native start --reset-cache )

These steps will fix the problem!

like image 141
Kashan Haider Avatar answered Sep 20 '22 20:09

Kashan Haider