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

Android build error. MainActivity.java:7: error: cannot find symbol - onCreate(Bundle savedInstanceState)

Open brkrtp opened this issue 9 years ago • 10 comments

"react": "16.0.0-alpha.12", "react-native": "0.47.0", "react-native-splash-screen": "^3.0.1" Build console: screen shot 2017-10-15 at 14 57 01 MainActivity.java; screen shot 2017-10-15 at 14 58 08

brkrtp avatar Oct 15 '17 11:10 brkrtp

İm solved https://github.com/react-native-component/react-native-smart-splash-screen/issues/20

brkrtp avatar Oct 15 '17 12:10 brkrtp

@brkrtp I'm experiencing the same error. The link in your latest comment is broken for me (404). What did you do to fix the issue?

brandonjyuhas avatar Nov 05 '17 04:11 brandonjyuhas

Hello, Have you found any solution for this ?

jnranawedo avatar Nov 15 '17 08:11 jnranawedo

@jnranawedo in my case, I wasn't including Bundle in android/app/src/main/java/com/<myapp>/MainActivity.java.

I solved the issue by adding these lines to the top of MainActivity.java:

import android.os.Bundle; // required for onCreate parameter
import org.devio.rn.splashscreen.SplashScreen; // required for react-native-splash-screen >= 0.3.1

brandonjyuhas avatar Nov 15 '17 18:11 brandonjyuhas

this might help you MainActivity.java

import android.os.Bundle; import com.facebook.react.ReactActivity; import com.cboy.rn.splashscreen.SplashScreen;

public class MainActivity extends ReactActivity { @Override protected void onCreate(Bundle savedInstanceState) { SplashScreen.show(this); // here super.onCreate(savedInstanceState); } // ...other code }

Salman98 avatar Feb 23 '18 14:02 Salman98

@brandonjyuhas solution worked but shouldnt this be in the docs? Or did i miss it?

jstansbe avatar Jan 03 '19 17:01 jstansbe

Yes, how is this not in the docs (still!)?

kg-currenxie avatar Aug 06 '19 09:08 kg-currenxie

Yes it's Working Just Add the this line given that document. MainActivity.java file

"import android.os.Bundle;"

Thankyou...

saikrishna407 avatar Sep 06 '19 11:09 saikrishna407

Yes, add this line on the top of MainActivity.java file import android.os.Bundle; // required for onCreate parameter

re-ali avatar May 24 '21 05:05 re-ali

import android.os.Bundle;

should be aded to the README, since it's by default not added in main activity file.

karladler avatar Aug 04 '22 20:08 karladler