React-native-navigation: White screen on every project android build

0

white screen on android

The whole day today I spent trying to build my app on android. But all the builds were successful only blank white screen show up at the end as a result.

I tried to run the example project in this repo, again the same white screen.

I am not sure what is going on or what I am doing wrong.

narek11 picture narek11  ·  18 Mar 2018

Most helpful comment

-10

Oh wow I found the solution. It seems its the android debug mode timing bug.

When you see the blank screen on startup in android:

1) hit the "square" button to show all open apps
2) Then press on your app
3) voila it renders

Here is screenshots of steps:

Noitidart picture Noitidart  ·  21 Mar 2018

All comments

0

Same here, I spent two days fiddling with this white screen trying to understand what was wrong. no luck.
React Native 0.53.3
RNN - 1.1.409

No errors or warnings on gradle build, targeted API is 26+
My MainApplication.java is

package com.archer.eurobloha;

import android.app.Application;

import com.oblador.vectoricons.VectorIconsPackage;
import io.invertase.firebase.RNFirebasePackage;
import com.BV.LinearGradient.LinearGradientPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.reactnativenavigation.NavigationApplication;

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

public class MainApplication extends NavigationApplication {

  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new VectorIconsPackage(),
            new LinearGradientPackage(),
            new RNFirebasePackage(),
            new RNFirebaseFirestorePackage()
    );
  }
  @Override
  public String getJSMainModuleName() {
    return "index";
  }


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


  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
    return getPackages();
  }
}
jahglow picture jahglow  ·  19 Mar 2018
-58

I tried to run the example project in this repo, again the same white screen.

Just npm installed and ran react-native run-android - seems to work fine. I'm closing the issue as it's a duplicate and there's not enough information.

guyca picture guyca  ·  19 Mar 2018
14

@guyca why are you closing this?

I am telling you that even the example app brings up white screen and you close this without saying anything?

Give us a project to clone and run that works.

I use genymotion emulator to run them.

narek11 picture narek11  ·  19 Mar 2018
2

@jahglow I went ahead and tried with RNN v2 and same white screen. Please let me know in case you have any success.
I will post my success status updates here for you and people.

narek11 picture narek11  ·  19 Mar 2018
1

I am also having this same issue. Steps to reproduce is following the steps from the installation - https://wix.github.io/react-native-navigation/#/installation-android

Except for me. I just kept running react-native run-android and once it did load. Most times its blank.

Noitidart picture Noitidart  ·  21 Mar 2018
-10

Oh wow I found the solution. It seems its the android debug mode timing bug.

When you see the blank screen on startup in android:

1) hit the "square" button to show all open apps
2) Then press on your app
3) voila it renders

Here is screenshots of steps:

Noitidart picture Noitidart  ·  21 Mar 2018
0

This is the bug that was affecting us - https://github.com/wix/react-native-navigation/issues/2180

Noitidart picture Noitidart  ·  21 Mar 2018
0

I'm also experiencing this white screen issue, and just as @narek11 I wonder why it was closed. Seems people are still experiencing this.

The fix suggested @Noitidart does not work for me. I'm stuck!

jaltin picture jaltin  ·  22 Mar 2018
0

@jaltin you might have a js error. And also your MainApplication.java should look like this:

package com.wix;

import com.reactnativenavigation.NavigationApplication;

import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

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

public class MainApplication extends NavigationApplication {

  @Override
  public boolean isDebug() {
    return BuildConfig.DEBUG;
  }

  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(

    );
  }

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

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

}
Noitidart picture Noitidart  ·  22 Mar 2018
1

Yes you are right about the js error being the problem for me @Noitidart.

I had a look in logcat in Android Studio and there I found warnings that I didn't have any icon for my tabs, just label and title was defined for my tabs.

This works ok in iOS but when trying to run without icons on Android it just gives the blank screen and the JS error. Once I added the icon it works well. * banging my head against the keyboard for not spotting this earlier *.

Thanks for your help!

jaltin picture jaltin  ·  22 Mar 2018
0

Thanks for sharing! That's an awesome help! I didn't know about looking at logcat.

Noitidart picture Noitidart  ·  22 Mar 2018
0

I resolve this bug by closing and opening the app again within the genymotion

felipecoders picture felipecoders  ·  18 Jul 2019
1

To fix this I had to run react-native start in a separate terminal and then run react-native run-android.

kennedymj97 picture kennedymj97  ·  20 Jul 2019
0

@kennedymj97 This worked. But why ? Is there a difference between running from android studio and running this app using react-native run-android ?

anunaybiswas picture anunaybiswas  ·  12 Aug 2019
0

@kennedymj97 Worked For me ....

sumukhah picture sumukhah  ·  28 Sep 2019
0

To fix this I had to run react-native start in a separate terminal and then run react-native run-android.

@kennedymj97 where should i type this in android studio???

ydvnishant001 picture ydvnishant001  ·  7 Mar 2020