Android blank white screen after launch
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 I get this error too. How can we fix it?
+1
try following steps:
rm -rf node_modulesrm -rf ~/.rncacheyarn cache cleanrm -rf android/build
make sure that the Metro Bundler isn't running, if so kill it.
yarn installornpm installthen start your react native android development.
I have the same issue :-(
@jctf Thank you for your suggestion, tried but the same problem persists.
- 1, Running in emulator and works fine, run on Device white Screen. Only Android, iOS works fine
+1 Getting this error as well
+1 the same error
+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')"
- 1 for same error
Same Error any solutions?
same error
It works well sometimes , and blank sometimes.
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.
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.
Yes, the problem exactly is missing icons define.
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))
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 ?
react-native 0.55.4 same error
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 !!