4

I just got this Layer exceeds max. dimensions supported by the GPU exception.

I have seen it mentioned in othere places like Scene transition with hero elements throws Layer exceeds max. dimensions supported by the GPU.

But in my case, I have a negative size. What I am doing is translating/animating a ViewPager outside the screen.

Any idea what to do ?

Full logs:

 W/OpenGLRenderer: Layer exceeds max. dimensions supported by the GPU (1080x-646, max=16384x16384)
 D/OpenGLRenderer: Current memory usage / total memory usage (bytes):
                     TextureCache          4266660 / 58720256
                     LayerCache           26787840 / 33554432 (numLayers = 8)
                       Layer size 1088x1024; isTextureLayer()=0; texid=43 fbo=0; refs=1
                       Layer size 1088x960; isTextureLayer()=0; texid=40 fbo=0; refs=1
                       Layer size 576x384; isTextureLayer()=0; texid=49 fbo=0; refs=1
                       Layer size 1088x1024; isTextureLayer()=0; texid=37 fbo=0; refs=1
                       Layer size 1088x128; isTextureLayer()=0; texid=36 fbo=0; refs=1
                       Layer size 1088x1024; isTextureLayer()=0; texid=46 fbo=0; refs=1
                       Layer size 1088x768; isTextureLayer()=0; texid=27 fbo=0; refs=1
                       Layer size 1088x1024; isTextureLayer()=0; texid=26 fbo=0; refs=1
                     Layers total   26787840 (numLayers = 8)
                     RenderBufferCache           0 /  8388608
                     GradientCache               0 /  1048576
                     PathCache                2925 / 16777216
                     TessellationCache        2232 /  1048576
                     TextDropShadowCache         0 /  6291456
                     PatchCache               6208 /   131072
                     FontRenderer 0 A8    
 E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
 E/MessageQueue-JNI: java.lang.IllegalStateException: Unable to create layer for ViewPager
                         at android.os.MessageQueue.nativePollOnce(Native Method)
                         at android.os.MessageQueue.next(MessageQueue.java:323)
                         at android.os.Looper.loop(Looper.java:135)
                         at android.app.ActivityThread.main(ActivityThread.java:5422)
                         at java.lang.reflect.Method.invoke(Native Method)
                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 D/AndroidRuntime: Shutting down VM
 E/AndroidRuntime: FATAL EXCEPTION: main
                   Process: , PID: 18453
                   java.lang.IllegalStateException: Unable to create layer for ViewPager
                       at android.os.MessageQueue.nativePollOnce(Native Method)
                       at android.os.MessageQueue.next(MessageQueue.java:323)
                       at android.os.Looper.loop(Looper.java:135)
                       at android.app.ActivityThread.main(ActivityThread.java:5422)
                       at java.lang.reflect.Method.invoke(Native Method)
                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Community
  • 1
  • 1
mbonnin
  • 6,893
  • 3
  • 39
  • 55

2 Answers2

1

This was due to a View being layout with bottom above top, I fixed it and now it doesn't crash anymore, even if the View is outside the screen.

mbonnin
  • 6,893
  • 3
  • 39
  • 55
0

I faced the same problem with the follwoing code

val t = supportFragmentManager.beginTransaction()
    t.replace(R.id.main_fl, fragment)
    t.setReorderingAllowed(true) ----> remove this
    t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE) ----> remove this

so by removeing set treasition and set recoding allowed ,I solved the problem , I think the problem was when moveing from a complex UI fragment to another complex UI fragment and also saving the instance of both fragment (i'm saving the fragments in the activity) and also using an animation when replacing cause this problem

Ahmed na
  • 1,084
  • 2
  • 13
  • 34