2016-09-27 86 views
1

當一個特定的dialogFragment啓動時顯示此異常。我很困惑,因爲它沒有顯示我的任何項目類,因此我不知道如何解決這個問題。此外,我沒有在片段中使用Bitmap類,所以這實在令人困惑。如何解決這個奇怪的「IllegalArgumentException:位圖大小超過32位」

請問您有解決方案嗎?

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) 
+0

集largeheap真正清單文件 –

+0

@PreetikaKaur請你能解釋一下你的答案? – X09

+0

對於較低版本的設備,內存大小有時會超過這麼難以支持這麼多內存位,這就是爲什麼我們在應用程序標記中的清單文件android:largeHeap =「true」中添加此內容的原因。嘗試一下,如果工作好,否則我們會看到其他一些soln。 –

回答

0

嘗試使用HierarchyViewer分析您的應用程序,並且應該分析應用程序中的內存。我認爲你只是有漏洞。

+0

就像我在我的問題中寫的,我沒有使用'Bitmap'類。謝謝你的回答,但它不能解決這個問題。 – X09

0
AndroidManifest文件下 應用標籤使用

機器人:largeHeap = 「真」

+0

請不要猶豫我懷疑你在這個答案中的知識,但請你能向我解釋你如何知道這是內存泄漏?如果是內存泄漏,它不應該顯示OOM異常嗎? – X09

+0

這個錯誤很好的解釋在http://stackoverflow.com/questions/9370145/mysterious-stacktrace-in-android-developer-console-bitmap-size-exceeds-32bits –

相關問題