问题
This exception is showing up when a particular dialogFragment is launched. I am confused because it's not showing my any of my project classes hence I don't know how to fix this. Moreover, I am not using the Bitmap
class in the fragment so this is really confusing.
Please do you have a solution for it?
09-27 12:11:47.440 4381-4381/com.ozuf.weper E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ozuf.weper, PID: 4381
java.lang.IllegalArgumentException: bitmap size exceeds 32 bits
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:908)
at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
at android.graphics.Bitmap.createBitmap(Bitmap.java:846)
at android.graphics.drawable.RippleDrawable.updateMaskShaderIfNeeded(RippleDrawable.java:691)
at android.graphics.drawable.RippleDrawable.drawBackgroundAndRipples(RippleDrawable.java:803)
at android.graphics.drawable.RippleDrawable.draw(RippleDrawable.java:641)
at android.view.View.getDrawableRenderNode(View.java:15867)
at android.view.View.drawBackground(View.java:15816)
at android.view.View.draw(View.java:15626)
at android.view.View.updateDisplayListIfDirty(View.java:14568)
at android.view.View.getDisplayList(View.java:14590)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3588)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3567)
at android.view.View.updateDisplayListIfDirty(View.java:14528)
at android.view.View.getDisplayList(View.java:14590)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3588)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3567)
at android.view.View.updateDisplayListIfDirty(View.java:14528)
at android.view.View.getDisplayList(View.java:14590)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3588)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3567)
at android.view.View.updateDisplayListIfDirty(View.java:14528)
at android.view.View.getDisplayList(View.java:14590)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3588)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3567)
at android.view.View.updateDisplayListIfDirty(View.java:14528)
at android.view.View.getDisplayList(View.java:14590)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2575)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2385)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2012)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1073)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5988)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
回答1:
Try to analyze your application with HierarchyViewer and you should analyze memory in your application. I think you just have leaks.
回答2:
in your AndroidManifest file under application tag use this
android:largeHeap="true"
来源:https://stackoverflow.com/questions/39723428/how-to-fix-this-weird-illegalargumentexception-bitmap-size-exceeds-32-bits