React-native-navigation: Android blank white screen after launch

24

Issue Description

When using react-native-navigation, the Android app launches but it only shows a white blank screen. It doesn't get connected to the debugger no matter what. Even when enabling or disabling the debugger, which I think isn't the problem. When checking Logcat in android studio this error stands out. E/unknown:ReactNative: Unable to display loading message because react activity isn't available It only happened after setting up my project with react-native-navigation that this happens.

This is only in Android, iOS works perfectly.

Steps to Reproduce / Code Snippets / Screenshots

Followed the set up for Android for the documentation and the end result of my MainApplication is

import com.airbnb.android.react.maps.MapsPackage;
import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativenavigation.NavigationApplication;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends NavigationApplication {

  @Override
  public boolean isDebug() {
    // Make sure you are using BuildConfig from your own application
    return BuildConfig.DEBUG;
  }

  public List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new ReactNativePushNotificationPackage(),
            new MapsPackage(),
            new ReactVideoPackage(),
            new VectorIconsPackage(),
            new ReactNativeLocalizationPackage(),
            new RNDeviceInfo()
    );
  }

  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
    return getPackages();
  }

  @Override
  public String getJSMainModuleName() {
    return "index";
  }


}

As for MainActivity

import com.reactnativenavigation.controllers.SplashActivity;

public class MainActivity extends SplashActivity {

}

Environment

  • React Native Navigation version: ^1.1.440
  • React Native version: ^0.53.0
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Device and Simulator, Debug
qasimalbaqali picture qasimalbaqali  ·  15 Apr 2018

Most helpful comment

-8

try following steps:

  • rm -rf node_modules
  • rm -rf ~/.rncache
  • yarn cache clean
  • rm -rf android/build

make sure that the Metro Bundler isn't running, if so kill it.

  • yarn install or npm install then start your react native android development.
jctf picture jctf  ·  17 Apr 2018

All comments

0

@guyca I get this error too. How can we fix it?

hamidhadi picture hamidhadi  ·  17 Apr 2018
0

+1

kermopajula picture kermopajula  ·  17 Apr 2018
-8

try following steps:

  • rm -rf node_modules
  • rm -rf ~/.rncache
  • yarn cache clean
  • rm -rf android/build

make sure that the Metro Bundler isn't running, if so kill it.

  • yarn install or npm install then start your react native android development.
jctf picture jctf  ·  17 Apr 2018
0

I have the same issue :-(

ghost picture ghost  ·  17 Apr 2018
0

@jctf Thank you for your suggestion, tried but the same problem persists.

qasimalbaqali picture qasimalbaqali  ·  17 Apr 2018
2
  • 1, Running in emulator and works fine, run on Device white Screen. Only Android, iOS works fine
fcochim picture fcochim  ·  23 Apr 2018
0

+1 Getting this error as well

juansalas picture juansalas  ·  23 Apr 2018
0

+1 the same error

jcsena picture jcsena  ·  24 Apr 2018
0

+1 the same error
error message:
05-05 06:45:02.317 3511-3511/com.ngm E/unknown:ReactNative: Unable to launch redbox because react activity is not available, here is the error that redbox would've displayed: console.error: "Error while starting app: TypeError: undefined is not an object (evaluating 'PropRegistry_1.default.save')"

pzw224 picture pzw224  ·  5 May 2018
0
  • 1 for same error
matzewagner picture matzewagner  ·  8 May 2018
0

Same Error any solutions?

maitham picture maitham  ·  8 May 2018
0

same error

escote picture escote  ·  14 May 2018
0

It works well sometimes , and blank sometimes.

ATShiTou picture ATShiTou  ·  14 May 2018
0

I had to downgrade react-native for this to work. Here are my package versions:

"react-native": "^0.52.0",
"react": "^16.2.0",
"react-native-navigation": "^1.1.440",

And for my gradle settings for Android as I saw that it actually makes a difference in my case when using react-native-navigation:

compileSdkVersion 25 buildToolsVersion '27.0.1'

minSdkVersion 18 targetSdkVersion 22

implementation "com.android.support:appcompat-v7:25.0.0"

Hope this comes into use for someone out there. Have struggled with this error for weeks now, and this was the only solution that I could find for me to continue working.

qasimalbaqali picture qasimalbaqali  ·  15 May 2018
0

Hmmm, not sure if that can help, but in my case I had other errors after, especially No icon defined for tab MyProject.Home :

ReactNativeJS  E  Error while starting app: Error: No icon defined for tab MyProject.Home
unknown:ReactNative  E  Unable to launch redbox because react activity is not available, here is the error that redbox would've displayed: console.error: "Error while starting app: Error: No icon defined for tab MyProject.Home"

Adding Icons on my tabs actually solved the problem.

adrienthiery picture adrienthiery  ·  17 May 2018
1

Yes, the problem exactly is missing icons define.

williamtran1988 picture williamtran1988  ·  4 Jun 2018
1

I am having the exact same issue, downgrading didn't seem to work either, I have not even started using tabs/icons.

Update: I am still having a blank screen, but that error is gone. Perhaps try this PR and see if it fixes the blank screen for you. (https://github.com/wix/react-native-navigation/pull/2801/files))

Geli25 picture Geli25  ·  22 Jun 2018
3

I did the react-native upgrade to 0.56 after compiling on the android I get the following error when trying to open the application:

E/ReactNativeJS: undefined is not an object (evaluating '_reactNative.Image.resizeMode.stretch')
E/unknown:ReactNative: Unable to launch redbox because react activity is not available, here is the error that redbox would've displayed: undefined is not an object (evaluating '_reactNative.Image.resizeMode.stretch')

Any idea how can I solve that ?

1fabiopereira picture 1fabiopereira  ·  30 Jul 2018
0

react-native 0.55.4 same error

brightsider picture brightsider  ·  12 Sep 2018
0

I also faced same issue when upgraded RNN from version 1.x.x to 1.1.x. Now again I've rolled back to RNN v 1.x.x by running command
yarn add [email protected]
Hope work for you as well !!

hani647 picture hani647  ·  17 Oct 2018
0

Any Loin here to solve this error, i think there is no because react native has one drawback which is there are many Run time error, when we want to run our application, React js is better than React_native
why errors are coming

ayankhan2415 picture ayankhan2415  ·  22 May 2019
0

Installed RNN using the guide, now my 'Hello World' application is just a white screen with 0 errors, 0 debugging output.

Not happy that this thread is closed without anything being fixed.

AlphaJuliettOmega picture AlphaJuliettOmega  ·  7 Dec 2020