React-native-splash-screen: react-native 0.45 MainActivity.java报错问题

Created on 7 Jul 2017  ·  2Comments  ·  Source: crazycodeboy/react-native-splash-screen

终端报错:

`/MainActivity.java:16: 错误: 找不到符号
protected void onCreate(Bundle savedInstanceState) {
^
符号: 类 Bundle
位置: 类 MainActivity
/home/littlestone/Documents/xingbang/android/app/src/main/java/com/xingbang/MainActivity.java:17: 错误: 找不到符号
SplashScreen.show(this,true);
^
符号: 变量 SplashScreen
位置: 类 MainActivity
2 个错误
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.
    `

    MainActivity.java添加的代码[ 我是直接添加在最后面的 ]:

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

react-native 版本:0.45

请问有什么解决办法?

Most helpful comment

you should import android.os.Bundle, you can find this in example code.

All 2 comments

I am having this issue as well, did you figure out how to fix it?

you should import android.os.Bundle, you can find this in example code.

Was this page helpful?
0 / 5 - 0 ratings