question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working with modified MainActivity for react-native-navigation

See original GitHub issue

Unfortunately the app crash on launch. Maybe this is due to the fact that the mainactivity class has been modified which extends the SplashActivity from com.reactnativenavigation.controllers.SplashActivity rather than the old school ReactActivity class.

Yes, I’m using the react-native-navigation by wix (https://github.com/wix/react-native-navigation)

Here’s the full code of my MainActivity.java, maybe I’m just doing something wrong.

import org.devio.rn.splashscreen.SplashScreen;
import com.reactnativenavigation.controllers.SplashActivity;
import android.os.Bundle;

public class MainActivity extends SplashActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);  // here
        super.onCreate(savedInstanceState);
    }
}

If anyone had a similar problem, please let me know for any solution thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:23

github_iconTop GitHub Comments

15reactions
xabreecommented, Dec 9, 2017

same problem here, when to try adb logcat I found error Can't convert to color:type=0x1

solve by: created file android/app/src/main/res/values/colors.xml and setting content <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#660B0B0B</color> </resources>

now splash screen working well with react-native-navigation on android and ios

MainActivity.java

package com.mmakmur;
import android.os.Bundle; // here
import com.facebook.react.ReactActivity;
import com.reactnativenavigation.controllers.SplashActivity;
import org.devio.rn.splashscreen.SplashScreen;

public class MainActivity extends SplashActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);  // here
        super.onCreate(savedInstanceState);
    }
}
5reactions
amikucommented, Nov 22, 2017

Same problem, and I wondered which step was wrong until saw this issue…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my react navigation not working on android?
Actually the problem was being caused by another package that was just added to the project and wasn't setup and being used. The...
Read more >
Getting started - React Navigation
React Navigation is born from the React Native community's need for an extensible yet ... be sure to make the necessary modifications to...
Read more >
Upgrading from 3.x - React Navigation - Netlify
To finalize installation of react-native-gesture-handler for Android, make the following modifications to MainActivity.java :.
Read more >
Add a splash screen to a React Native app - Medium
Also note that I'm not an iOS nor Android developer, so some steps may surely be improved. I'll be happy to read how...
Read more >
Migrating off RNGHEnabledRootView | React Native Gesture ...
Migrating off RNGHEnabledRootView · Update MainActivity.java ​ · Check if your app works correctly​ · Update your JS code​.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found