mehcode / rn-splash-screen

A JavaScript-controlled splash-screen for React Native designed to be run directly after the native splash-screen.
MIT License
350 stars 95 forks source link

package is no find, #57

Open MTTTM opened 6 years ago

MTTTM commented 6 years ago

F:\3kwcommunity\android\app\src\main\java\com\simpleapp\MainActivity.java:9: 错误: 程序包com.mehcode.reactnative.splashscreen不存在 import com.mehcode.reactnative.splashscreen.SplashScreen; ^ F:\3kwcommunity\android\app\src\main\java\com\simpleapp\MainActivity.java:43: 错误: 找不到符号 protected void onCreate(Bundle savedInstanceState) { ^ 符号: 类 Bundle 位置: 类 MainActivity F:\3kwcommunity\android\app\src\main\java\com\simpleapp\MainActivity.java:45: 错误: 找不到符号 SplashScreen.show(this, getReactInstanceManager()); ^ 符号: 变量 SplashScreen 位置: 类 MainActivity 3 个错误 :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

my computer system is window 10.

sinapcs commented 6 years ago

add this to dependencies of build.gradle compile project(':rn-splash-screen')

GodVampire commented 6 years ago

I have same error : "错误: 找不到符号 SplashScreen.show(this, getReactInstanceManager()); " I have already add compile project(':rn-splash-screen') in build.gradle

my MainActivity.java:

import com.reactnativenavigation.controllers.SplashActivity;

import android.graphics.Color; import android.os.Bundle;

import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.mehcode.reactnative.splashscreen.SplashScreen; import com.mehcode.reactnative.splashscreen.SplashScreenPackage;

public class MainActivity extends SplashActivity {

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