java.lang.IllegalStateException: Unable to create layer for v

纵饮孤独 提交于 2019-12-21 03:25:51

问题


I have this exception on crashlytics and have no idea how to reproduce or what the cause might be. Does anyone have any pointers as to where I should start looking? Only affects Android 5+.

Fatal Exception: java.lang.IllegalStateException: Unable to create layer for v
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5585)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

Thanks.

Edit: I would like to update that it doesn't only affect Android 5, it seems to affect Android 5+


回答1:


This issue seems related to Scene transition with hero elements throws Layer exceeds max. dimensions supported by the GPU.

You should look at any activity transaction you are making and particularly for the effects of makeSceneTransitionAnimation().




回答2:


adding android:hardwareAccelerated="false" to application tag in manifest solve my problem




回答3:


I also faced this issue when I tried to create a simple View. I just had to set android:forceHasOverlappingRendering="false" in its xml. Note that it only works from API level 24.



来源:https://stackoverflow.com/questions/43748222/java-lang-illegalstateexception-unable-to-create-layer-for-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!