Random JSApplicationIllegalArgumentException crashes on Android
See original GitHub issue- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info: System: OS: macOS 10.14 CPU: x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Memory: 40.02 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.6.0 - /usr/local/bin/node Yarn: 1.6.0 - ~/.yarn/bin/yarn npm: 5.3.0 - /usr/local/bin/npm Watchman: 4.7.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0 Android SDK: Build Tools: 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3 API Levels: 21, 23, 25, 26, 27, 28 IDEs: Android Studio: 2.2 AI-145.3537739 Xcode: 10.0/10A255 - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: 0.57.2 => 0.57.2 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 1.3.0 react-native-git-upgrade: 0.2.7
Android build versions: buildToolsVersion = “27.0.3” minSdkVersion = 21 compileSdkVersion = 27 targetSdkVersion = 27 supportLibVersion = “27.1.1”
Description
Hi there, since I upgraded to react native 0.57 I receive some crashes on Android. It’s not reproducable, but If I e.g reload a list over and over again the app crashes at some point (sometimes it takes 100 tries, sometimes only 2 or 3). The exception is always a JSApplicationIllegalArgumentException. But with different properties (height, width, paddingHorizontal, …). I have no glue where it is coming from, because the crashes also occure on different places in the app.
If you need more information I’m glad to help.
Thanks David
The stacktrace from sentry looks like this:
java.lang.ClassCastException: Value for fill cannot be cast from ReadableNativeArray to Double
at com.facebook.react.bridge.ReadableNativeMap.checkInstance(ReadableNativeMap.java:148)
at com.facebook.react.bridge.ReadableNativeMap.getValue(ReadableNativeMap.java:127)
at com.facebook.react.bridge.ReadableNativeMap.getDouble(ReadableNativeMap.java:168)
at com.facebook.react.bridge.DynamicFromMap.asDouble(DynamicFromMap.java:64)
at com.facebook.react.uimanager.LayoutShadowNode$MutableYogaValue.setFromDynamic(LayoutShadowNode.java:67)
at com.facebook.react.uimanager.LayoutShadowNode.setHeight(LayoutShadowNode.java:157)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:105)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:157)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:61)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:458)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:295)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:377)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
java.lang.reflect.InvocationTargetException: null
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:105)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:157)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:61)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:458)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:295)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:377)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'height' in shadow node of type: RCTView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:116)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:157)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:61)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:458)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:295)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:377)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
Reproducible Demo
Issue Analytics
- State:
- Created 5 years ago
- Reactions:26
- Comments:37 (3 by maintainers)
I can confirm. Crashlytics gives us more and more this kind of report since we have upgraded react-native to 0.57 Most common crashes are:
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException Error while updating property 'marginBottom' in shadow node of type: RCTText
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException Error while updating property 'bottom' in shadow node of type: RCTView
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException Error while updating property 'paddingHorizontal' in shadow node of type: RCTView
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException Error while updating property 'fill' of a view managed by: RNSVGPath
Is there any workaround /solution /planned bugfix for that?
We are seeing a lot of these crashes in Android and are on RN 59.10. Are there any plans to fix this soon?