question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LessonThumbnailImageView causes a "Render Problem" in Android studio

See original GitHub issue

Describe 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:

  1. Open Android Studio
  2. Go to any xml file that contains LessonThumbnailImageView (e.g. ongoing_story_card.xml)
  3. 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 Screenshot from 2020-08-15 14-59-21

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
rt4914commented, Oct 7, 2020

@ARJUPTA Thanks for mentioning this.

1reaction
Arjuptacommented, Oct 6, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found