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

Android blank white screen after launch #3044

Closed
varqasim opened this issue Apr 15, 2018 · 23 comments
Closed

Android blank white screen after launch #3044

varqasim opened this issue Apr 15, 2018 · 23 comments

Comments

@varqasim
Copy link

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
@guyca guyca added the v1 label Apr 15, 2018
@hamidhadi
Copy link
Contributor

hamidhadi commented Apr 17, 2018

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

@kermopajula
Copy link

+1

@jctf
Copy link

jctf commented Apr 17, 2018

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.

@ghost
Copy link

ghost commented Apr 17, 2018

I have the same issue :-(

@varqasim
Copy link
Author

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

@fcochim
Copy link

fcochim commented Apr 23, 2018

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

@juansalas
Copy link

+1 Getting this error as well

@jcsena
Copy link

jcsena commented Apr 24, 2018

+1 the same error

@pzw224
Copy link

pzw224 commented May 5, 2018

+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')"

@matzewagner
Copy link

  • 1 for same error

@maitham
Copy link

maitham commented May 8, 2018

Same Error any solutions?

@escote
Copy link

escote commented May 14, 2018

same error

@ATShiTou
Copy link

It works well sometimes , and blank sometimes.

@varqasim
Copy link
Author

varqasim commented May 15, 2018

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.

@adrienthiery
Copy link
Contributor

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.

@williamtran1988
Copy link

Yes, the problem exactly is missing icons define.

@Geli25
Copy link

Geli25 commented Jun 22, 2018

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//pull/2801/files))

@1fabiopereira
Copy link

1fabiopereira commented Jul 30, 2018

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 ?

@brightsider
Copy link

react-native 0.55.4 same error

@hani647
Copy link

hani647 commented Oct 17, 2018

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 react-native-navigation@1.x.x
Hope work for you as well !!

@guyca guyca closed this as completed Oct 18, 2018
@ayankhan2415
Copy link

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

@AlphaJuliettOmega
Copy link

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.

@muhnur29
Copy link

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

hei i have problem my project can't showing after run on my device
i build list view using array adapter
but nothing happen in my project just white screen and tittle project
can you help me answer please

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