react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

After upgrading to RN 0.60.4 - can't compile.

Open wmonecke opened this issue 7 years ago • 12 comments

After having updated to RN 0.60.4 I can't compile on iOS.

Error: #import <React/RCTBridgeModule.h> file not found.

It appears as if react-native-splash-screen can't find the React dependency. How do I tell react-native-splash-screen where React is? Since 0.60 React is added via Pods explicitly.

Is there any way to add this project as a Pod instead of adding it manually?

wmonecke avatar Jul 31 '19 16:07 wmonecke

I am facing this issue after upgrading to RN 0.60.4

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

Do I need to add anything specifically in Podfile? Autolinking worked completely fine in Android

rajeshde avatar Aug 01 '19 07:08 rajeshde

I was able to compile it with RN 0.60.4

Steps to make it work:

react-native unlink react-native-splash-screen
rm -rf Pods
remove pod react-native-splash-screen from Pods if you have one
revert all steps from installation guide for ios: https://github.com/crazycodeboy/react-native-splash-screen
add pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen' to Pods
pod install 
Clean Build in XCode

Everything should work now.

Regarding issue with OBJC_CLASS$_RNSplashScreen you need to remove react native splash screen fom Header Search Paths (revert all steps from installation guide)

jpudysz avatar Aug 01 '19 07:08 jpudysz

Seeking your assistance to upgrade android file inside APP_NAME/node_modules/react-native-splash-screen/android bcoz it happens to Android too (especially when Build Release)..

it still has compile 'com.android.support:appcompat-v7:26.1.0' in the dependencies

mattop1709 avatar Aug 02 '19 09:08 mattop1709

since 0.60+, u can use another library https://github.com/zoontek/react-native-bootsplash

vinurs avatar Aug 02 '19 09:08 vinurs

okay then, thanks!

mattop1709 avatar Aug 02 '19 11:08 mattop1709

Same issue app keeping stopping . can't compile with RN ^0.60.0 / react-native-splash-screen ^3.2.0 in Android。

0xinhua avatar Aug 04 '19 03:08 0xinhua

Same issue app keeping stopping . can't compile with RN ^0.60.0 / react-native-splash-screen ^3.2.0 in Android。

I just installed it. Auto linking worked completely fine on android. No extra configuration.

For iOS, I followed the installation instruction from README

rajeshde avatar Aug 04 '19 03:08 rajeshde

@rajeshde It works now in Android.

I using react-native ^0.60.0 and react-native-splash-screen ^3.2.0, I face the same problem. I solve this issue with:

  1. change the code SplashScreen.show(this) with SplashScreen.show(this, true) in android/app/src/main/java/com/yourapp/MainActivity.java :

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

  1. add a launch_screen.xml in your android/app/src/main/res/layout folder with code :

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/launch_screen" android:orientation="vertical"> </LinearLayout>

  1. add colors.xml in your android/app/src/main/res/values folder with code: <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#000000</color> </resources>

The README or guide document should be updated.

Good luck.

0xinhua avatar Aug 04 '19 04:08 0xinhua

@rajeshde It works now in Android.

I using react-native ^0.60.0 and react-native-splash-screen ^3.2.0, I face the same problem. I solve this issue with:

  1. change the code SplashScreen.show(this) with SplashScreen.show(this, true) in android/app/src/main/java/com/yourapp/MainActivity.java :

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

  1. add a launch_screen.xml in your android/app/src/main/res/layout folder with code :

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/launch_screen" android:orientation="vertical"> </LinearLayout>

  1. add colors.xml in your android/app/src/main/res/values folder with code: <?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#000000</color> </resources>

The README or guide document should be updated.

Good luck.

I using react-native ^0.60.4 and react-native-splash-screen ^3.2.0,i try your solution , but it no use

solfKwolf avatar Aug 07 '19 07:08 solfKwolf

Same issue and Android is keep crushing silently on launch

smxdevst avatar Aug 08 '19 23:08 smxdevst

I needed to make this change to init the SoLoader, now android loads fine on .60 import com.facebook.soloader.SoLoader;

    protected void onCreate(Bundle savedInstanceState) {
        SoLoader.init(this, false); // <-This
        SplashScreen.show(this, R.style.SplashTheme);  
        super.onCreate(savedInstanceState);

    }```

jedashford avatar Aug 11 '19 05:08 jedashford

Android is keep crushing on real device only

sasclau avatar Aug 24 '19 21:08 sasclau