Repository navigation
undefined is not an object (evaluating '_reactNativeSplashScreen2.default.hide') #100
Description
Activity
I also had the exact same problem
+1
Do check the android/app/src/main/java/com/appname/MainActivity.java
package com.testapp; import android.os.Bundle; // I missed out this line import com.facebook.react.ReactActivity; import org.devio.rn.splashscreen.SplashScreen; // According to the instruction, you would just need to use one of the imports, depending on the react-native-splash-screen version. public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "TestApp"; } @Override protected void onCreate(Bundle savedInstanceState) { SplashScreen.show(this); super.onCreate(savedInstanceState); } }I screwed up the previous project so badly so I recreated a new project, it worked after I sort out the MainActivity.java.
any solution regarding this problem, I also have the same problem.
please take look at this issue #30 you possibly get help from there.
- Insert
#import "SplashScreen.h"to./ios/<AppName>/AppDelegate.mif not exists - Rebuild
Probably, it will be fix.
Reacted by thitoo- Insert
This did not work on Apple TV 4K.
@Balamir Hello sir,
I have follower the exact same thing mentioned in this Splash Screen Tutorial but I am getting the exact same error mentioned above in my ios devices.
I also cleaned the cache and rebuild the project several times but still it didn't workYou are missing some java code either in MainActivity.java or MainApplication.java.
Make sure you have
new SplashScreenReactPackage()inside the MainApplication.java otherwise SplashScreen will not be exposed to react code.
I had the same issue adding
new SplashScreenReactPackage()fixed it.Reacted by tyasink, fariya12 and Yash AgrawalReacted by Sidharth Devaraj, minhnbh, Mayur Panchal, Maycon Mesquita, Przemysław Przebieglec and fariya12Hello @creativeaura I have already fixed the error which I was getting in my application reguarding the splash screen by following some extra steps
1. I mentioned the LaunchScreen.xib file in Lunch Screen File 2. Also I added link manually in build setting > Header Search Path > $(SRCROOT)/../node_modules/react-native-splash-screen/ios 3. I dragged react-native-splash-screen/ios/SplashScreen.xcodeproj/ to my project library manually . 4. Dragged libSplashScreen.a from SplashScreen.xcodeproj to Project General Tab > Linked Frameworks and Libraries and dropped it some where with the library 5. Command + Shift + K and Command +R@khadkaPratik The fix I mentioned was for Android.
Reacted by Pratik khadkaplease help i have the same issue and all my files are correct
If someone give error like this in iOS can fix by the way
When you link manually in build setting > Header Search Path > $(SRCROOT)/../node_modules/react-native-splash-screen/ios set recursive
Hope help youMake sure you add below lines in MainApplication.java
protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new MainReactPackage(), new SvgPackage(), new VectorIconsPackage(), new SplashScreenReactPackage() //here ); }This will fix the issue!!!
Also make sure you have imported the below package
import org.devio.rn.splashscreen.SplashScreenReactPackage;Reacted by Artyom Khreshchikov, HeeSeok Lee, Yevhen Nezhuta, Freddecarcans, Guna Shekar Proddaturi, Azam, Juanpa and pramod pandeyReacted by Guna Shekar Proddaturi and Azamfor iOS developer, try to remove libSplashScreen.a from [Project Name -> build Phases -> Link Binary With Libraries ]. Hope it helps
Same issue with iOS 13.1, RN 0.61.5 and this package using 3.2.0. @anhdevit and @someoneNameGrey answers sadly didn't help 🙁
Is this package still maintains ?Reacted by Anh Devfor (ios) Remember to
cd ios && pod installI know this issue is closed, but if someone came here hopelessly I found a simple solution:
In the file
ios/<yourAppName>/AppDelegate.madd:#import "RNSplashScreen.h"I found solution in my case.
Auto linking for this package does not work even if you are using the latest version of react native.
Go for the manual linking. Thanks!!
I have already configure my code just like the instruction to use the splash screen but when I compile it using my Redmi Note 3 it returns error like this:
in line of code:
react-native: "0.48.4"
react-native-splash-screen: "^3.0.1"
node: v6.11.2
npm: 5.3.0
please tell me how to handle this case.