crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.61k stars 1.09k forks source link

Is react-native link still required in React-native .60 and above #422

Open vvavdiya opened 5 years ago

vvavdiya commented 5 years ago

The new new version of react-native module linking happening automatically. For this module, Linking happening automatically or still, we need to run command for link module?

PetrVasilev commented 5 years ago

For iOS: After npm install react-native-splash-screen Run react-native link react-native-splash-screen And go to ios folder and run pod install. Then edit appDelegate.m file and it will work.

For Android: I will check

MITDD6338 commented 5 years ago

For iOS: After npm install react-native-splash-screen Run react-native link react-native-splash-screen And go to ios folder and run pod install. Then edit appDelegate.m file and it will work.

@PetrVasilev
still ios not working

Ade94 commented 5 years ago

You don't need to run react-native link. Just do

npm install react-native-splash-screen
cd ios
pod update
cd ..

Then edit appDelegate.m file and it will work

MITDD6338 commented 5 years ago

npm install react-native-splash-screen cd ios pod update cd .. @Ade94 this is workable?

Ade94 commented 5 years ago

@MITDD6338 works for me. React-native link is not needed.

congzhou09 commented 5 years ago

You don't need to run react-native link. Just do

npm install react-native-splash-screen
cd ios
pod update
cd ..

Then edit appDelegate.m file and it will work

Wonderful! This works for me with react-native@0.60.5. Many thanks!!

muhaimincs commented 5 years ago

how about android? How do I find layout

jasperkuperus commented 5 years ago

Just tried on RN 0.60.5 and I can confirm that autolinking works on both iOS and Android. Don't run react-native link, you'll only get warnings. Just don't forget to run pod install in the ios/ folder.

sabun123 commented 5 years ago

Tried the above but I seem to be getting:

fatal error: 'RNSplashScreen.h' file not found

In Xcode, it's

'RNSplashScreen.h' file not found

Basically, it can't handle the

#import "RNSplashScreen.h"

inside AppDelegate.m

I'm using RN 0.60.5, react-native-splash-screen 3.2.0, I've made sure to unlink first since I'm coming from an upgrade:

react-native unlink react-native-splash-screen

Then cd ios and did a pod update and then tried to run a build. Both via terminal and Xcode, it gets stuck at the AppDelegate.m file since it can't find RNSplashScreen.h.

Any suggestions?

GunnarAK commented 5 years ago

@sabun123 did you place the react-native-splash-screen/ios searchpath inside the header search path section of project?

sabun123 commented 5 years ago

Hey @GunnarAK thanks for the quick response!

I skipped those instructions since I thought they didn't to apply to RN 0.60. Just added

$(SRCROOT)/../node_modules/react-native-splash-screen/ios

to the Header Search Paths like it says in the instructions and this problem is no more.

Now I'm running into

1319 duplicate symbols for architecture x86_64

But this is probably from another package. Thanks for the help!

GunnarAK commented 5 years ago

From what I understood this is the case when you still have the libraries in your Libraries folder. https://github.com/facebook/react-native/issues/25484#issuecomment-508327556

Haven't tested this, but I ran into the same issue with react-native-splash-screen;

2 duplicate symbols for architecture <arch_name>
jamesawer3 commented 5 years ago

Hi @crazycodeboy, @radko93 If we run pod update any pod is installing newly??? When I run pod update I don't see new pod installed!

jamesawer3 commented 5 years ago

I'm getting this error if I add $(SRCROOT)/../node_modules/react-native-splash-screen/ios in Header Search Path

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNSplashScreen", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I remove $(SRCROOT)/../node_modules/react-native-splash-screen/ios in Header Search Path, I'm getting 'RNSplashScreen.h' file not found

HrudakovSerhii commented 5 years ago

"react-native": "0.60.5", "react-native-splash-screen": "^3.2.0" -> Pods are not installed (checked podfile.lock). But if you set "react-native-splash-screen": "^3.1.0" -> pod will install 3.2.0 version. Changing from #import "SplashScreen.h" to "RNSplashScreen.h" will make it work. Old solution (https://github.com/crazycodeboy/react-native-splash-screen/issues/19#issuecomment-406697970), but why this issue even uppear?