1

Having an issue in a fresh react-native project, v0.63.2. npm install'd react-native-splash-screen, did not run react-native link <...>. Manullay linked the package by:

  • editing settings.gradle ->

    include ':react-native-splash-screen' project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen')

  • added dependency to app/build.gradle ->

dependencies { ... implementation project(':react-native-splash-screen') }

  • added package to MainApplication.java:

import org.devio.rn.splashscreen.SplashScreenReactPackage;

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          packages.add(new SplashScreenReactPackage());
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }
      };

However I noticed theres no react-native-splash-screen module in the Android directory view:

enter image description here

I then tried running react-native link react-native-splash-screen which did not affect the change I need

The build error:

Unable to resolve dependency for ':app@debug/compileClasspath': 
Could not resolve project :react-native-splash-screen.
Affected Modules: app

how to fix? I tried most of the suggestions here: Android studio 3.0: Unable to resolve dependency for :app@dexOptions/compileClasspath': Could not resolve project :animators to no avail

Jim
  • 1,988
  • 6
  • 34
  • 68

0 Answers0