React-native-navigation: [V2] Android package com.reactnativenavigation.controllers does not exist

Created on 8 Feb 2019  ·  7Comments  ·  Source: wix/react-native-navigation

While implementing Splash screen in android, getting error package com.reactnativenavigation.controllers does not exist

I try to implement Splash screen in Android as documented https://wix.github.io/react-native-navigation/#/android-specific-use-cases?id=splash-screen and getting following error

/myproject/android/app/src/main/java/com/buygud/MainActivity.java:3: error: package com.reactnativenavigation.bridge does not exist

import com.reactnativenavigation.bridge.NavigationReactPackage;

My MainActivity.java

import com.reactnativenavigation.NavigationActivity;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.widget.LinearLayout;

import com.reactnativenavigation.controllers.SplashActivity;

public class MainActivity extends SplashActivity {
    @Override
    public LinearLayout createSplashLayout() {
        LinearLayout splash = new LinearLayout(this);
        Drawable splash_screen_bitmap = ContextCompat.getDrawable(getApplicationContext(),R.drawable.splash_screen_bitmap);
        splash.setBackground(splash_screen_bitmap);

        return splash;
    }
}

Environment

  • React Native Navigation version: 0.58.4
  • React Native version: 2.10.0
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): All
🏚 stale

All 7 comments

any updates on this?

Nothing yet, for quick workaround I use below technique in MainActivity

public class MainActivity extends NavigationActivity {
    @Override
    public void addDefaultSplashLayout() {
        LinearLayout splash = new LinearLayout(this);
        Drawable splash_screen_bitmap = ContextCompat.getDrawable(getApplicationContext(),R.drawable.splash_screen_bitmap);
        splash.setBackground(splash_screen_bitmap);

        setContentView(splash);
    }
}

just override addDefaultSplashLayout() with your own content. For splash screen content, I use guide at https://medium.com/@pqkluan/how-to-implement-splash-screen-in-react-native-navigation-ee2184a1a96

i dont why i am getting this weird error of package not found

.../MainActivity.java:7: error: package com.reactnativenavigation does not exist
import com.reactnativenavigation.NavigationActivity;

  • React Native: 0.58.4
  • React Native Navigation: 2.11.0

@arahmanali You might miss something during installation, follow https://wix.github.io/react-native-navigation/#/docs/Installing. One more solution stop existing module bundler and run react-native run-android again. If stille facing issue, try posting on Stackoverflow with your code.

@iShankarG i have fixed it by reverting my code and reinstall the package, thanks though :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

Was this page helpful?
0 / 5 - 0 ratings