Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: package com.cboy.rn.splashscreen does not exist

i was using this react-native package and it was working fine, until I deleted everything and went for a fresh start, after i set up my project. i did "

npm install

and then npm install react-native-splash-screen and it showed me

[email protected]

and then when react-native link react-native-splash-screen i get

Scanning 559 folders for symlinks in mydirectory\node_modules (28ms)

now after i set up my files and edit the code as directed here and use

react-native run-android

I get this error

error: package com.cboy.rn.splashscreen does not exist

error: cannot find symbol SplashScreen.show(this); symbol: variable SplashScreen location: class MainActivity

I did not do anything new, neither modified code, Also, i am not sure if it happened at install or link but the output of the command was something like "

dependencies for iOS
dependencies for android

like image 923
sayyed Saulat Avatar asked Jul 06 '17 08:07

sayyed Saulat


2 Answers

It's seems like the package have changed location. It used to be com.cboy.rn and now seems to be org.devio.rn


So in MainApplication.java

import org.devio.rn.splashscreen.SplashScreenReactPackage;

And in MainActivity.java

import org.devio.rn.splashscreen.SplashScreen;

But even then the app kept crashing, So I re-install everything and the paths were correct this time with the Automatic Installation.

like image 111
aaafly Avatar answered Sep 24 '22 17:09

aaafly


The automatic linking didn't work fully for me and the website instructions seem to be out of date. I had to add these:

\\MainApplication.java
import org.devio.rn.splashscreen.SplashScreenReactPackage;

\\ MainActivity.java
import org.devio.rn.splashscreen.SplashScreen;
import android.os.Bundle;
like image 24
Peconia Avatar answered Sep 22 '22 17:09

Peconia