react-content-loader icon indicating copy to clipboard operation
react-content-loader copied to clipboard

Crash on Android RN 0.76.1 without newArch

Open smfunder opened this issue 1 year ago • 5 comments

hey guys, I'm getting this crash in Android. Here are some details. This is happening only on Release mode, I suspect because in release mode everything goes faster than in debug mode. RN version 0.76.1 (newArch/bridgeless mode disabled) react-native-svg 15.9.0 react-content-loader (which uses svg lib) 7.0.2

The app is crashing when rendering Home Screen which use react-content-loader. I also tried to remove all this loader component but the crash was still there.

Very few times I got in Sentry the very same stack trace as the original post here.

I suspect the issue is coming from this library but I'm not pretty sure. Other svg stuff seems to work correctly.

My code. The SkeletonLoader component is then used inside a FlashList on ListEmptyComponent

Is there anyone facing this issue?

import React from 'react'
import { screenWidth } from '../../../utilities/measurement'
import ContentLoader, { Rect, Circle } from 'react-content-loader/native'

/**
 * Create a component for an empty chat cell view with skeleton
 * to use it while the chats are loaded
 */
const EmptyChatCell = () => {
  return (
    <ContentLoader
      speed={2}
      width={screenWidth}
      height={74}
      viewBox={`0 0 ${screenWidth} ${74}`}
      backgroundColor="#dfdbf2"
      foregroundColor="#eceaf3">
      <Rect x="83" y="10" rx="3" ry="3" width={screenWidth - 103} height="60" />
      <Circle cx="45" cy="40" r="25" />
    </ContentLoader>
  )
}

/**
 * Render an animated skeleton of empty messages to show
 * while loading the messages in the chat list
 */
const SkeletonLoader = () => {
  return (
    <>
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
      <EmptyChatCell />
    </>
  )
}

export default SkeletonLoader
java.lang.IllegalArgumentException: null
    at android.graphics.LinearGradient.nativeCreate(LinearGradient.java)
    at android.graphics.LinearGradient.createNativeInstance(LinearGradient.java:156)
    at android.graphics.Shader.getNativeInstance(Shader.java:175)
    at android.graphics.Paint.getNativeInstance(Paint.java:681)
    at android.graphics.BaseCanvas.drawPath(BaseCanvas.java:327)
    at android.graphics.Canvas.drawPath(Canvas.java:1908)
    at com.horcrux.svg.RenderableView.draw(RenderableView.java:526)
    at com.horcrux.svg.RenderableView.render(RenderableView.java:487)
    at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
    at com.horcrux.svg.GroupView.draw(GroupView.java:91)
    at com.horcrux.svg.RenderableView.render(RenderableView.java:487)
    at com.horcrux.svg.SvgView.drawChildren(SvgView.java:336)
    at com.horcrux.svg.SvgView.drawOutput(SvgView.java:282)
    at com.horcrux.svg.SvgView.onDraw(SvgView.java:135)
    at android.view.View.draw(View.java:22350)
    at com.facebook.react.views.view.ReactViewGroup.draw(ReactViewGroup.java:970)
    at android.view.View.updateDisplayListIfDirty(View.java:21226)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
    at android.view.View.updateDisplayListIfDirty(View.java:21186)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:4101)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3828)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3099)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
    at android.view.Choreographer.doCallbacks(Choreographer.java:796)
    at android.view.Choreographer.doFrame(Choreographer.java:731)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

smfunder avatar Nov 21 '24 16:11 smfunder

Anyone facing the same? Months later I've updated React Native to 0.76.3 now with new arch enabled and the app is randomly crashing when loading on startup. Any help would be appreciated.

smfunder avatar Jan 14 '25 01:01 smfunder

Is there any fix for this, even a hacky one?

EliG-TA avatar Jul 15 '25 22:07 EliG-TA

is there any fix to this?

JDiazEarthTrack avatar Aug 11 '25 05:08 JDiazEarthTrack

@EliG-TA @smfunder Did you guys found solution for this??

AnkitOli avatar Aug 11 '25 13:08 AnkitOli

Anyone facing the same? Months later I've updated React Native to 0.76.3 now with new arch enabled and the app is randomly crashing when loading on startup. Any help would be appreciated.

Same issue

namdh03 avatar Aug 30 '25 13:08 namdh03