SDK47 crash error on Android build doubleValue() on null with SVG

Please provide the following:

  1. SDK Version: 47
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

After upgrading to SDK 47 the app crashes on load on Android only. In the Expo Go app everything is fine.

The following error occures after debugging with adb logcat:

java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.horcrux.svg.SVGLength.from(SVGLength.java:111)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.horcrux.svg.LinearGradientView.setX1(LinearGradientView.java:53)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.horcrux.svg.RenderableViewManager$LinearGradientManager.setX1(RenderableViewManager.java:1959)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.horcrux.svg.RenderableViewManager$LinearGradientManager.setX1(RenderableViewManager.java:1904)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.viewmanagers.RNSVGLinearGradientManagerDelegate.setProperty(RNSVGLinearGradientManagerDelegate.java:67)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:46)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:84)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:142)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIImplementation.synchronouslyUpdateViewOnUIThread(UIImplementation.java:306)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIManagerModule.synchronouslyUpdateViewOnUIThread(UIManagerModule.java:402)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.animated.PropsAnimatedNode.restoreDefaultValues(PropsAnimatedNode.java:90)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.animated.NativeAnimatedNodesManager.restoreDefaultValues(NativeAnimatedNodesManager.java:500)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.animated.NativeAnimatedModule$20.execute(NativeAnimatedModule.java:910)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.animated.NativeAnimatedModule$ConcurrentOperationQueue.executeBatch(NativeAnimatedModule.java:191)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.animated.NativeAnimatedModule$2.execute(NativeAnimatedModule.java:373)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:579)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:915)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1026)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1086)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:970)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:796)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:727)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7656)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
02-15 13:34:41.627 12122 12149 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
02-15 13:34:41.633   546 12225 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2

What can I do to fix this problem?

Hi @gijsjager

Can you post some of the code? It looks like it has something to do with an SVG LinearGradient. In particular the “x1” value.

The problem is that I don’t know which code I should post. Because I can’t find the exact SVG that is causing this crash (if it is an SVG from my code).

There is no SVG using the LinearGradient option.

Troubleshooting is a bit of a problem too because I need to build first which takes a lot of time.
These are my dependencies:

{
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-navigation/bottom-tabs": "^6.3.2",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/native-stack": "^6.7.0",
    "@reduxjs/toolkit": "^1.8.3",
    "expo": "^47.0.0",
    "expo-asset": "~8.7.0",
    "expo-barcode-scanner": "~12.1.0",
    "expo-calendar": "~11.0.1",
    "expo-constants": "~14.0.2",
    "expo-device": "~5.0.0",
    "expo-font": "~11.0.1",
    "expo-linking": "~3.3.0",
    "expo-location": "~15.0.1",
    "expo-notifications": "~0.17.0",
    "expo-secure-store": "~11.2.0",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.6",
    "expo-web-browser": "~12.0.0",
    "formik": "^2.2.9",
    "lottie-react-native": "5.1.4",
    "moment": "^2.29.4",
    "prop-types": "^15.8.1",
    "react": "18.1.0",
    "react-content-loader": "^6.2.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-confirmation-code-field": "^7.3.1",
    "react-native-geocoding": "^0.5.0",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-get-random-values": "^1.8.0",
    "react-native-hyperlink": "0.0.22",
    "react-native-maps": "1.3.2",
    "react-native-range-slider-expo": "^1.4.3",
    "react-native-reanimated": "~2.12.0",
    "react-native-reanimated-carousel": "^3.0.4",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-svg": "13.4.0",
    "react-native-web": "~0.18.7",
    "react-redux": "^8.0.2",
    "redux-persist": "^6.0.0",
    "sentry-expo": "~6.0.0",
    "uuid": "^9.0.0",
    "yup": "^0.32.11"
  }

hmmm…

OK, there are some parts of the stack trace to do with animation. So maybe it’s to do with lottie-react-native, react-native-reanimated, or react-native-reanimated-carousel

I don’t think you should need to rebuild to troubleshoot this. I’m pretty sure you should be able to create one development build with the above dependencies. Then adjust the JavaScript to see if the problem changes or goes away. Or else revert the JavaScript back to the default App.js and then start adding stuff back until the problem occurs.

Allright! I will remove one of those dependencies and try to figure out what is causing this problem. I will come back to this with the result!

Try leaving the dependencies as-is and just comment out the JavaScript code that references them. I’d start with Lotti. If that’s not it then you can start thinking about the other possibilities.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.