onCreate method does not exist in MainActivity.java
See original GitHub issueThe onCreate method does not exists in MainActivity.java and after creating it as described in documentation, the app wont open and crashes.
What I’m using: “react-native”: “0.66.4”, “react-native-splash-screen”: “^3.3.0”,
The Platform: Android
`package com.app;
import android.os.Bundle; import com.facebook.react.ReactActivity;
// react-native-splash-screen >= 0.3.1 import org.devio.rn.splashscreen.SplashScreen;
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 void onCreate(Bundle savedInstanceState) { SplashScreen.show(this); // rn splash screen
super.onCreate(savedInstanceState); }
@Override protected String getMainComponentName() { return “Admin”; } }`
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8
Top GitHub Comments
please add this line in MainActivvity.java
import android.os.Bundle;
Had the same issue, followed this and fixed it https://github.com/crazycodeboy/react-native-splash-screen/issues/167#issuecomment-517971996