Unable to launch logbox because react was unable to create the root view in Google Pixel 8.0

Viewed 2347

APK installed in device but when i open showing error (Only for android 8.1)

Device: Google Pixel
Operating System: Android 8.0
Screen size: 5.0 in - 2.5 x 4.4 in
Viewport: 411 x 731 dp
Aspect Ratio: 16 : 9
07-22 12:57:46.668 E/unknown:ReactNative( 6529): Unable to launch logbox because react was unable to create the root view 

Complete log file

1 Answers

Solution

In the root of your application.

Import ignoreWarning.js file present in utils folder (or anywhere) only in dev mode.

if (__DEV__) {
  import('./utils/ignoreWarnings');
}

Inside utils folder -> ignoreWarning.js

import {LogBox} from 'react-native';

LogBox.ignoreLogs([]);
Related