LessonThumbnailImageView causes a "Render Problem" in Android studio
See original GitHub issueDescribe the bug
The custom view LessonThumbnailImageView
is causing a rendering problem in android studio when it is used in a layout file.
If it is used in some layout file, you will not be able to see the layout preview.
To Reproduce Steps to reproduce the behavior:
- Open Android Studio
- Go to any xml file that contains
LessonThumbnailImageView
(e.g.ongoing_story_card.xml
) - You will not be able to see the preview of the layout
Error Log
java.lang.IllegalStateException: View org.oppia.app.customview.LessonThumbnailImageView{79d58923 V.ED..... ......I. 0,0-0,0 #7f09016e app:id/lesson_thumbnail} does not have a Fragment set
at androidx.fragment.app.FragmentManager.findFragment(FragmentManager.java:799)
at org.oppia.app.customview.LessonThumbnailImageView.onAttachedToWindow(LessonThumbnailImageView.kt:101)
at android.view.View.dispatchAttachedToWindow(View.java:19575)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:335)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:396)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:209)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$6(RenderTask.java:734)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Expected behavior The preview should work correctly
Screenshots
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Android Studio rendering problems - Stack Overflow
In new update android studio 2.2 facing rendering issue then follow this steps. I fixed it - in styles.
Read more >Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
Read more >Render Error Fix for Android Studio & internal.widget ...
This is a workaround to fix the rendering error that comes up in Android Studio 1.2.1.1.Namely.android.support.v7.internal.widget.
Read more >The design preview not work with the new Android Studio ...
iomob.net created issue #1 ... Kotlin plugin: 213-1.7.10-release-for-android-studio-AS6777.52. Android Gradle Plugin: 7.3.0. Gradle: 7.5.1
Read more >How do I remove rendering problems in Android studio? - Quora
Hence the UI render produces error rendering the new UI elements classes. Just clean your project by Build -> clean project. Then again...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ARJUPTA Thanks for mentioning this.
@MohamedMedhat1998 I just wanted to add one thing that, while trying to find a solution for this issue, I tried to re-type the whole LessonThumbnailImageView block of XML after removing it (removed it to check whether the other views are rendering correctly). While retyping this block of XML I saw all the views being rendered normally, but if the layout file is opened again then this issue arises.
I just mentioned this because it might be helpful to you.