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

PinchImageView加载长图(宽度屏幕长度/高度很小的图)会oom,Canvas: trying to draw too large(129709492bytes) bitmap #53

Open
bhd119 opened this issue Jul 17, 2020 · 2 comments

Comments

@bhd119
Copy link

bhd119 commented Jul 17, 2020

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.oaphone, PID: 4592
java.lang.RuntimeException: Canvas: trying to draw too large(129709492bytes) bitmap.
at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:280)
at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:88)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:548)
at android.widget.ImageView.onDraw(ImageView.java:1434)
at com.reactlibrary.sodaPhotoView.PinchImageView.onDraw(PinchImageView.java:610)
at android.view.View.draw(View.java:21629)
at android.view.View.updateDisplayListIfDirty(View.java:20498)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.draw(View.java:21632)
at androidx.viewpager.widget.ViewPager.draw(ViewPager.java:2426)
at android.view.View.updateDisplayListIfDirty(View.java:20498)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.updateDisplayListIfDirty(View.java:20489)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.updateDisplayListIfDirty(View.java:20489)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.updateDisplayListIfDirty(View.java:20489)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.updateDisplayListIfDirty(View.java:20489)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.updateDisplayListIfDirty(View.java:20489)
at android.view.View.draw(View.java:21358)
at android.view.ViewGroup.drawChild(ViewGroup.java:4425)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4177)
at android.view.View.draw(View.java:21632)
at com.android.internal.policy.DecorView.draw(DecorView.java:839)
at android.view.View.updateDisplayListIfDirty(View.java:20498)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:575)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:581)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:654)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3730)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3525)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2862)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1817)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7778)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031)
at android.view.Choreographer.doCallbacks(Choreographer.java:854)
at android.view.Choreographer.doFrame(Choreographer.java:789)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7584)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

@Victor2018
Copy link

我也遇到了,不知道这个问题解决了没?

@boycy815
Copy link
Owner

@Victor2018 @bhd119 可否发一张图片例子,以及机型内存大小

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants