crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.61k stars 1.09k forks source link

[3.0.6] Crashes on Android #124

Open joncursi opened 6 years ago

joncursi commented 6 years ago

3.0.1 works on Android, but 3.0.6 causes an immediate crash. I can't even open the app, it just pops up the crash alert. Logs don't show anything useful, either:

$ react-native log-android
Scanning folders for symlinks in /Users/joncursi/Sites/joncursi/redbird-native/node_modules (29ms)
Starting the logger (/Users/joncursi/Library/Android/sdk/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V)...
--------- beginning of main
--------- beginning of system
11-09 15:30:00.726  3099  3099 D ReactNative: [CodePush] Loading JS bundle from "assets://index.android.bundle"
11-09 15:30:00.727  3099  3099 D ReactNative: ReactInstanceManager.ctor()
--------- beginning of crash
11-09 15:30:50.816  3511  3511 D ReactNative: [CodePush] Loading JS bundle from "assets://index.android.bundle"
11-09 15:30:50.817  3511  3511 D ReactNative: ReactInstanceManager.ctor()
shifeng1993 commented 6 years ago

Me too

3210jr commented 6 years ago

Experiencing the same issue... @joncursi are you using react-native-navigator?

joncursi commented 6 years ago

No I’m using react-navigation

payen83 commented 6 years ago

I'm having the same problem. Any solution to this?

ligongxiang commented 6 years ago

yes,I have a same problem

ryam4u commented 6 years ago

this is solved by creating the file: android/app/src/main/res/values/colors.xml `<?xml version="1.0" encoding="utf-8"?>

`
AmandeepSingh06 commented 6 years ago

Even I am finding a crash on app launch. This is the log I am getting

Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x1 at android.content.res.TypedArray.getColor(TypedArray.java:451) at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:3777) at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:3981) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:383) at android.app.Dialog.setContentView(Dialog.java:512) at org.devio.rn.splashscreen.b$1.run(SplashScreen.java:32)

ryam4u commented 6 years ago

@AmandeepSingh06 yes, that is the error, it is solved by adding the file: android/app/src/main/res/values/colors.xml

celodauane commented 6 years ago

@ryam4u that also worked for me. I could not leave the color as an empty string so I added a transparent status bar.

I ended up with the in my android/app/src/main/res/values/colors.xml:

`<?xml version="1.0" encoding="utf-8"?>

#00ffffff `
payen83 commented 6 years ago

@dauane Thank you. Your solution works for me.

edo1493 commented 6 years ago

Same here.

yewenxiang23 commented 6 years ago

@ryam4u thank you Your solution suits me.

elribonazo commented 6 years ago

Thanks for the workarround, +1.

BenFausch commented 6 years ago

I just lost so much time because of this bug, thanks for the help guys, and @crazycodeboy please update your README!

ABKZR commented 6 years ago

C:\Project\Login_Page>react-native log-android Scanning folders for symlinks in C:\Project\Login_Page\node_modules (40ms) Starting the logger (c:\Users\Abkzr\AppData\Local\Android\Sdk/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V)... --------- beginning of system --------- beginning of main --------- beginning of crash 01-07 18:24:03.636 3155 3155 D ReactNative: ReactInstanceManager.ctor() 01-07 18:24:03.939 3155 3155 D ReactNative: ReactInstanceManager.createReactContextInBackground() 01-07 18:24:03.939 3155 3155 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner() 01-07 18:24:03.999 3155 3155 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer() 01-07 18:24:04.000 3155 3155 D ReactNative: ReactInstanceManager.recreateReactContextInBackground() 01-07 18:24:04.000 3155 3155 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread() 01-07 18:24:04.078 3155 3177 D ReactNative: ReactInstanceManager.createReactContext() 01-07 18:24:05.180 3155 3177 D ReactNative: Initializing React Xplat Bridge. 01-07 18:24:05.194 3155 3177 D ReactNative: Initializing React Xplat Bridge before initializeBridge 01-07 18:24:05.264 3155 3177 D ReactNative: Initializing React Xplat Bridge after initializeBridge 01-07 18:24:05.339 3155 3177 D ReactNative: CatalystInstanceImpl.runJSBundle() 01-07 18:24:05.363 3155 3184 D ReactNative: ReactInstanceManager.setupReactContext() 01-07 18:24:05.363 3155 3184 D ReactNative: CatalystInstanceImpl.initialize() 01-07 18:24:05.381 3155 3184 D ReactNative: ReactInstanceManager.attachRootViewToInstance() 01-07 18:24:07.032 3155 3183 I ReactNativeJS: Running application "Login" with appParams: {"rootTag":1}. DEV === true, development-level warning are ON, performance optimizations are OFF 01-07 18:28:47.897 3155 3183 E ReactNativeJS: Hot loading isn't working because it cannot connect to the development server. 01-07 18:28:47.897 3155 3183 E ReactNativeJS: 01-07 18:28:47.897 3155 3183 E ReactNativeJS: Try the following to fix the issue: 01-07 18:28:47.897 3155 3183 E ReactNativeJS: - Ensure that the packager server is running and available on the same network 01-07 18:28:47.897 3155 3183 E ReactNativeJS: - Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connec ted devices 01-07 18:28:47.897 3155 3183 E ReactNativeJS: - If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device 01-07 18:28:47.897 3155 3183 E ReactNativeJS: - If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address a nd the port of the local dev server - e.g. 10.0.1.1:8081 01-07 18:28:47.897 3155 3183 E ReactNativeJS: 01-07 18:28:47.897 3155 3183 E ReactNativeJS: URL: 10.0.2.2:8081 01-07 18:28:47.897 3155 3183 E ReactNativeJS: 01-07 18:28:47.897 3155 3183 E ReactNativeJS: Error: recvfrom failed: ECONNRESET (Connection reset by peer) 01-07 18:28:48.010 3155 3155 D ReactNative: ReactInstanceManager.detachViewFromInstance() 01-08 12:08:12.824 4271 4271 D ReactNative: ReactInstanceManager.ctor() 01-08 12:08:12.873 4271 4271 D ReactNative: ReactInstanceManager.createReactContextInBackground() 01-08 12:08:12.873 4271 4271 D ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner() 01-08 12:09:35.347 4271 4271 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer() 01-08 12:09:35.347 4271 4271 D ReactNative: ReactInstanceManager.recreateReactContextInBackground() 01-08 12:09:35.347 4271 4271 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread() 01-08 12:09:35.373 4271 4294 D ReactNative: ReactInstanceManager.createReactContext() 01-08 12:09:35.488 4271 4294 D ReactNative: Initializing React Xplat Bridge. 01-08 12:09:35.550 4271 4294 D ReactNative: Initializing React Xplat Bridge before initializeBridge 01-08 12:09:35.568 4271 4294 D ReactNative: Initializing React Xplat Bridge after initializeBridge 01-08 12:09:35.569 4271 4294 D ReactNative: CatalystInstanceImpl.runJSBundle() 01-08 12:09:35.571 4271 4298 D ReactNative: ReactInstanceManager.setupReactContext() 01-08 12:09:35.571 4271 4298 D ReactNative: CatalystInstanceImpl.initialize() 01-08 12:09:35.591 4271 4298 D ReactNative: ReactInstanceManager.attachRootViewToInstance() 01-08 12:09:35.970 4271 4297 I ReactNativeJS: Running application "Laptop" with appParams: {"rootTag":1}. DEV === true, development-level warning are ON, performance optimizations are OFF 01-08 12:10:51.295 4271 4271 D ReactNative: ReactInstanceManager.detachViewFromInstance()

help me android crashed

bjonamu commented 5 years ago

My MainActivity.java is totally different

public class MainActivity extends ReactActivity {

  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
      @Override
      protected ReactRootView createRootView() {
       return new RNGestureHandlerEnabledRootView(MainActivity.this);
      }
    };
  }

  /**
    * Returns the name of the main component registered from JavaScript.
    * This is used to schedule rendering of the component.
    */
  @Override
  protected String getMainComponentName() {
      return "AppName";
  }
}

Am I to remove the createReactActivityDelegate method in favour of onCreate? It doesn't seem like they can co-exist.

bjonamu commented 5 years ago

For me replacing createReactActivityDelegate method in with an onCreate method worked.

devonwesley commented 4 years ago

For me I spelled lauch_screen.xml instead launch and also, I needed all of the drawable-folder.

rohitsingh2410 commented 2 years ago

any update on this?