Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on Android (release variant) with Canvas: trying to draw too large in logcat #23479

Closed
EgidioCaprino opened this issue Feb 15, 2019 · 14 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@EgidioCaprino
Copy link

🐛 Bug Report

App crashes, with no error, in release variant on Android. The logcat shows this error:

02-15 15:47:13.074 12078 12078 E AndroidRuntime: java.lang.RuntimeException: Canvas: trying to draw too large(146506816bytes) bitmap.
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:98)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.RoundedDrawable.draw(RoundedDrawable.java:376)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.RoundedBitmapDrawable.draw(RoundedBitmapDrawable.java:46)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:145)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.ScaleTypeDrawable.draw(ScaleTypeDrawable.java:123)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.FadeDrawable.drawDrawableWithAlpha(FadeDrawable.java:302)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.FadeDrawable.draw(FadeDrawable.java:289)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:145)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.drawee.generic.RootDrawable.draw(RootDrawable.java:81)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.widget.ImageView.onDraw(ImageView.java:1342)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20207)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.widget.ScrollView.draw(ScrollView.java:1739)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:402)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.widget.ScrollView.draw(ScrollView.java:1739)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:402)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:672)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:19935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.draw(View.java:20210)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.widget.ScrollView.draw(ScrollView.java:1739)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:402)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4317)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4290)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:19042)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:3311)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3115)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2484)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:761)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:696)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6718)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-15 15:47:13.074 12078 12078 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

To Reproduce

I have no idea where the error lies exactly. It is probably related to the rendering of an Image component.

Expected Behavior

The app should not crash 🙂

Code Example

I cannot be sure because the error produced no stack trace for the JS part of the application, but I suppose the poblem might be start from this rendering:

<ListItem {...props} avatar style={itemStyle}>
  <Left>
    {otherUsers.length === 1
      ? <ContactThumbnail contact={otherUsers[0]} />
      : (
        <Thumbnail
          source={avatarPlaceholder}
          style={{
            width: dimensions.avatar.contactThumbnail.display,
            height: dimensions.avatar.contactThumbnail.display,
          }}
        />
      )
    }
    {count
      ? (
        <Badge info style={styles.badge}>
          <Text style={styles.text}>{count}</Text>
        </Badge>
      )
      : null
    }
    {conversation.selected
      ? (
        <Badge success style={styles.selectedBadge}>
          <Text style={styles.tick}></Text>
        </Badge>
      )
      : null
    }
  </Left>
  <Body>
    <Text>
      {title}
    </Text>
    {lastMessage
      ? <LastMessagePreview {...lastMessage} />
      : <Text>{' '}</Text>
    }
  </Body>
  <Right>
    {lastMessage
      ? <DateFormat date={lastMessage.createdDate} />
      : <DateFormat date={conversation.createdDate} />
    }
  </Right>
</ListItem>

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 34.70 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.9.0 - /usr/local/bin/node
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 27, 28
        Build Tools: 27.0.3, 28.0.0, 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.7.0 => 16.7.0
      react-native: ^0.58.3 => 0.58.3
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
@dulmandakh
Copy link
Contributor

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@hzburki
Copy link

hzburki commented Apr 24, 2019

I have the same issue .. I uploaded a new version (of my app) on the play store, it has a lot of changes to the previous code and new feature as well. The error only occurs on some devices, does not occur on most.

I have no way to reproduce the error. I don't even know why it's throwing this error.

@jdnichollsc
Copy link

same issue here using expo

@ru88s
Copy link

ru88s commented Jun 11, 2019

same the bug.
I also using expo.

@mastepanoski
Copy link

mastepanoski commented Jun 11, 2019

Same bug. Using expo 33 (latest release). It only happens on Android 7 (Nougat).
I found a solution here

@EgidioCaprino
Copy link
Author

Thank you all for replying to our issue. Eventually, we upgraded react-native dependency in our app and the problem is not happening anymore.

@Brian-McBride
Copy link

@EgidioCaprino What version of expo and react-native are you running now to get past this issue?

@EgidioCaprino
Copy link
Author

EgidioCaprino commented Jul 1, 2019

This error happened again for us with React Native 0.59.9.

Stack trace
java.lang.RuntimeException: Canvas: trying to draw too large(107619876bytes) bitmap.
    at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
    at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:97)
    at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
    at com.facebook.drawee.drawable.RoundedDrawable.draw(RoundedDrawable.java:376)
    at com.facebook.drawee.drawable.RoundedBitmapDrawable.draw(RoundedBitmapDrawable.java:46)
    at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:145)
    at com.facebook.drawee.drawable.ScaleTypeDrawable.draw(ScaleTypeDrawable.java:123)
    at com.facebook.drawee.drawable.FadeDrawable.drawDrawableWithAlpha(FadeDrawable.java:302)
    at com.facebook.drawee.drawable.FadeDrawable.draw(FadeDrawable.java:289)
    at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:145)
    at com.facebook.drawee.generic.RootDrawable.draw(RootDrawable.java:81)
    at android.widget.ImageView.onDraw(ImageView.java:1349)
    at android.view.View.draw(View.java:20370)
    at android.view.View.updateDisplayListIfDirty(View.java:19315)
    at android.view.View.draw(View.java:20093)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4421)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4207)
    at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:684)
    at android.view.View.draw(View.java:20373)
    at android.view.View.updateDisplayListIfDirty(View.java:19315)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4405)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4385)
    at android.view.View.updateDisplayListIfDirty(View.java:19274)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:800)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:3496)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3283)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2818)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1780)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7827)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
    at android.view.Choreographer.doCallbacks(Choreographer.java:723)
    at android.view.Choreographer.doFrame(Choreographer.java:658)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Can you please re-open this issue?

@Parrryy
Copy link

Parrryy commented Jul 10, 2019

I'm also getting this issue on Android 8.0, react-native 59.8. Only happens in a release build of the application.

Stack Trace
``` Fatal Exception: java.lang.RuntimeException: Canvas: trying to draw too large(121096800bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw + 229(DisplayListCanvas.java:229) at android.view.RecordingCanvas.drawBitmap + 97(RecordingCanvas.java:97) at android.graphics.drawable.BitmapDrawable.draw + 529(BitmapDrawable.java:529) at com.facebook.drawee.drawable.RoundedDrawable.draw + 376(RoundedDrawable.java:376) at com.facebook.drawee.drawable.RoundedBitmapDrawable.draw + 46(RoundedBitmapDrawable.java:46) at com.facebook.drawee.drawable.ForwardingDrawable.draw + 145(ForwardingDrawable.java:145) at com.facebook.drawee.drawable.ScaleTypeDrawable.draw + 123(ScaleTypeDrawable.java:123) at com.facebook.drawee.drawable.FadeDrawable.drawDrawableWithAlpha + 302(FadeDrawable.java:302) at com.facebook.drawee.drawable.FadeDrawable.draw + 289(FadeDrawable.java:289) at com.facebook.drawee.drawable.ForwardingDrawable.draw + 145(ForwardingDrawable.java:145) at com.facebook.drawee.generic.RootDrawable.draw + 81(RootDrawable.java:81) at android.widget.ImageView.onDraw + 1349(ImageView.java:1349) at android.view.View.draw + 20370(View.java:20370) at android.view.View.updateDisplayListIfDirty + 19315(View.java:19315) at android.view.View.draw + 20093(View.java:20093) at android.view.ViewGroup.drawChild + 4421(ViewGroup.java:4421) at android.view.ViewGroup.dispatchDraw + 4207(ViewGroup.java:4207) at com.facebook.react.views.view.ReactViewGroup.dispatchDraw + 684(ReactViewGroup.java:684) at android.view.View.updateDisplayListIfDirty + 19306(View.java:19306) at android.view.View.draw + 20093(View.java:20093) at android.view.ViewGroup.drawChild + 4421(ViewGroup.java:4421) at android.view.ViewGroup.dispatchDraw + 4207(ViewGroup.java:4207) at android.view.View.draw + 20373(View.java:20373) at android.widget.ScrollView.draw + 2731(ScrollView.java:2731) at com.facebook.react.views.scroll.ReactScrollView.draw + 400(ReactScrollView.java:400) at android.view.View.updateDisplayListIfDirty + 19315(View.java:19315) at android.view.View.draw + 20093(View.java:20093) at android.view.ViewGroup.drawChild + 4421(ViewGroup.java:4421) at android.view.ViewGroup.dispatchDraw + 4207(ViewGroup.java:4207) at com.facebook.react.views.view.ReactViewGroup.dispatchDraw + 684(ReactViewGroup.java:684) at android.view.View.updateDisplayListIfDirty + 19306(View.java:19306) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ViewGroup.recreateChildDisplayList + 4405(ViewGroup.java:4405) at android.view.ViewGroup.dispatchGetDisplayList + 4385(ViewGroup.java:4385) at android.view.View.updateDisplayListIfDirty + 19274(View.java:19274) at android.view.ThreadedRenderer.updateViewTreeDisplayList + 686(ThreadedRenderer.java:686) at android.view.ThreadedRenderer.updateRootDisplayList + 692(ThreadedRenderer.java:692) at android.view.ThreadedRenderer.draw + 800(ThreadedRenderer.java:800) at android.view.ViewRootImpl.draw + 3496(ViewRootImpl.java:3496) at android.view.ViewRootImpl.performDraw + 3283(ViewRootImpl.java:3283) at android.view.ViewRootImpl.performTraversals + 2818(ViewRootImpl.java:2818) at android.view.ViewRootImpl.doTraversal + 1780(ViewRootImpl.java:1780) at android.view.ViewRootImpl$TraversalRunnable.run + 7827(ViewRootImpl.java:7827) at android.view.Choreographer$CallbackRecord.run + 911(Choreographer.java:911) at android.view.Choreographer.doCallbacks + 723(Choreographer.java:723) at android.view.Choreographer.doFrame + 658(Choreographer.java:658) at android.view.Choreographer$FrameDisplayEventReceiver.run + 897(Choreographer.java:897) at android.os.Handler.handleCallback + 789(Handler.java:789) at android.os.Handler.dispatchMessage + 98(Handler.java:98) at android.os.Looper.loop + 164(Looper.java:164) at android.app.ActivityThread.main + 6944(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run + 327(Zygote.java:327) at com.android.internal.os.ZygoteInit.main + 1374(ZygoteInit.java:1374) ```

@EgidioCaprino
Copy link
Author

We got this error again today. Can you please reopen this issue?

@Dhanraj-bidchat
Copy link

Its still there in react-native: "0.60.6"

@feliperoan
Copy link

Hello, apart from the error that I also have, has anyone opted for an alternative solution? I have to show the image but I don't know how to really solve it in react-native: "0.60.6"

@avirefundit
Copy link

Getting this error rn 0.61.5, not expo. I've got it from Crashlytics.

@zcoon
Copy link

zcoon commented Mar 2, 2020

Initially we were experiencing this crash too when we only had a single splash screen asset in our android project. We solved this issue by adding additional splash screen assets into our android project based on the specs available here : https://stackoverflow.com/a/27125893

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests