Repository navigation
[3.0.6] Crashes on Android #124
Description
Activity
Me too
Experiencing the same issue... @joncursi are you using react-native-navigator?
No I’m using react-navigation
I'm having the same problem. Any solution to this?
yes,I have a same problem
this is solved by creating the file:
android/app/src/main/res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark"><!-- Colour of your status bar here --></color> </resources>Reacted by Floris, doujianwei, giridharsk, Andrey, likeconan, Diamant Haxhimusa, Abdullah Bilal, Dinuka Salwathura, Victor Osas Ighalo, Oguzhan Inan and 16 moreReacted by Dihan and Aashish SinghalReacted by Bryce Pavey, Celo, Evgeny Krasovsky, Nate River, JenSebastian, Muhammad Kamran Younis, Edoardo Moreni, dharakhatri88, Adhyan Srivastava, Alex Autem and 20 moreReacted by Dimitris Mpavelas, zhouzhi, DougThwaites and Valentin GegouxReacted by Valentin GegouxEven 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)@AmandeepSingh06 yes, that is the error, it is solved by adding the file:
android/app/src/main/res/values/colors.xml@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"?> <resources> <color name="primary_dark">#00ffffff</color> </resources>Reacted by Ferdy Fauzi, Dean, ttc, Edoardo Moreni, ducci91, Toshinori Tsugita, 漂泊80, Floris, doujianwei, Benny Ng and 26 moreReacted by Yoandy Pérez Villazón, Oguzhan Inan, Jacob Bodkin and zhouzhiReacted by Yoandy Pérez Villazón and zhouzhi@dauane Thank you. Your solution works for me.
Same here.
@ryam4u thank you Your solution suits me.
Thanks for the workarround, +1.
I just lost so much time because of this bug, thanks for the help guys, and @crazycodeboy please update your README!
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
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
createReactActivityDelegatemethod in favour ofonCreate? It doesn't seem like they can co-exist.Reacted by Jhoan BorgesFor me replacing createReactActivityDelegate method in with an onCreate method worked.
For me I spelled
lauch_screen.xmlinsteadlaunchand also, I needed all of the drawable-folder.any update on this?
3.0.1works on Android, but3.0.6causes an immediate crash. I can't even open the app, it just pops up the crash alert. Logs don't show anything useful, either: