Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White screen on every project android build #2883

Closed
narek11 opened this issue Mar 18, 2018 · 17 comments
Closed

White screen on every project android build #2883

narek11 opened this issue Mar 18, 2018 · 17 comments

Comments

@narek11
Copy link

narek11 commented Mar 18, 2018

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.

@jahglow
Copy link

jahglow commented Mar 19, 2018

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();
  }
}

@guyca
Copy link
Collaborator

guyca commented Mar 19, 2018

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 guyca closed this as completed Mar 19, 2018
@narek11
Copy link
Author

narek11 commented Mar 19, 2018

@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
Copy link
Author

narek11 commented Mar 19, 2018

@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.

@Noitidart
Copy link

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
Copy link

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
Copy link

This is the bug that was affecting us - #2180

@jaltin
Copy link

jaltin commented Mar 22, 2018

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!

@Noitidart
Copy link

@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";
  }

}

@jaltin
Copy link

jaltin commented Mar 22, 2018

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!

@Noitidart
Copy link

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

@felipecoders
Copy link

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

@kennedymj97
Copy link

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

@anunaybiswas
Copy link

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

@sumukhah
Copy link

@kennedymj97 Worked For me ....

@ydvnishant001
Copy link

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???

@adityakmr7
Copy link

I am facing the same issue, have anyone found any solution for this yet please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests