react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Android blank white screen after launch

Open varqasim opened this issue 8 years ago • 23 comments

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

varqasim avatar Apr 15 '18 11:04 varqasim

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

hamidhadi avatar Apr 17 '18 07:04 hamidhadi

+1

kermopajula avatar Apr 17 '18 08:04 kermopajula

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 avatar Apr 17 '18 09:04 jctf

I have the same issue :-(

ghost avatar Apr 17 '18 10:04 ghost

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

varqasim avatar Apr 17 '18 19:04 varqasim

  • 1, Running in emulator and works fine, run on Device white Screen. Only Android, iOS works fine

fcochim avatar Apr 23 '18 06:04 fcochim

+1 Getting this error as well

juansalas avatar Apr 23 '18 15:04 juansalas

+1 the same error

jcsena avatar Apr 24 '18 18:04 jcsena

+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 avatar May 05 '18 06:05 pzw224

  • 1 for same error

matzewagner avatar May 08 '18 19:05 matzewagner

Same Error any solutions?

maitham avatar May 08 '18 20:05 maitham

same error

escote avatar May 14 '18 03:05 escote

It works well sometimes , and blank sometimes.

ATShiTou avatar May 14 '18 12:05 ATShiTou

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.

varqasim avatar May 15 '18 00:05 varqasim

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 avatar May 17 '18 21:05 adrienthiery

Yes, the problem exactly is missing icons define.

williamtran1988 avatar Jun 04 '18 02:06 williamtran1988

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 avatar Jun 22 '18 01:06 Geli25

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 avatar Jul 30 '18 12:07 1fabiopereira

react-native 0.55.4 same error

brightsider avatar Sep 12 '18 06:09 brightsider

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 avatar Oct 17 '18 05:10 hani647