java.util.concurrent.TimeoutException: Preview timed out while rendering the layout. This typically happens when there is an infinite loop or unbounded recursion in one of the custom views.

tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    'preview timed out while rendering the layout infinite loop or unbounded recursion' when I duplicated some TableRows

    Stack Overflow | 9 months ago | Sushant Baskota
    java.util.concurrent.TimeoutException: Preview timed out while rendering the layout. This typically happens when there is an infinite loop or unbounded recursion in one of the custom views.

    Root Cause Analysis

    1. java.util.concurrent.TimeoutException

      Preview timed out while rendering the layout. This typically happens when there is an infinite loop or unbounded recursion in one of the custom views.

      at java.util.ArrayList.indexOf()
    2. Java RT
      ArrayList.contains
      1. java.util.ArrayList.indexOf(ArrayList.java:317)
      2. java.util.ArrayList.contains(ArrayList.java:300)
      2 frames
    3. com.android.layoutlib
      DelegateManager.addNewDelegate
      1. com.android.layoutlib.bridge.impl.DelegateManager.addNewDelegate(DelegateManager.java:132)
      1 frame
    4. Android Platform
      Drawable.createFromXml
      1. android.graphics.drawable.VectorDrawable_Delegate.nCreateTree(VectorDrawable_Delegate.java:94)
      2. android.graphics.drawable.VectorDrawable.nCreateTree(VectorDrawable.java)
      3. android.graphics.drawable.VectorDrawable.access$300(VectorDrawable.java:204)
      4. android.graphics.drawable.VectorDrawable$VectorDrawableState.createNativeTree(VectorDrawable.java:824)
      5. android.graphics.drawable.VectorDrawable$VectorDrawableState.access$000(VectorDrawable.java:761)
      6. android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:581)
      7. android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
      8. android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224)
      9. android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197)
      9 frames
    5. com.android.layoutlib
      ResourceHelper.getDrawable
      1. com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316)
      1 frame
    6. Android Platform
      Drawable.createFromXml
      1. android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:142)
      2. android.content.res.Resources.getDrawable(Resources.java:763)
      3. android.graphics.drawable.AnimatedVectorDrawable.inflate(AnimatedVectorDrawable.java:373)
      4. android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
      5. android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224)
      6. android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197)
      6 frames
    7. com.android.layoutlib
      ResourceHelper.getDrawable
      1. com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316)
      1 frame
    8. Android Platform
      Drawable.createFromXml
      1. android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:687)
      2. android.graphics.drawable.AnimatedStateListDrawable.parseTransition(AnimatedStateListDrawable.java:473)
      3. android.graphics.drawable.AnimatedStateListDrawable.inflateChildElements(AnimatedStateListDrawable.java:455)
      4. android.graphics.drawable.AnimatedStateListDrawable.inflate(AnimatedStateListDrawable.java:385)
      5. android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
      6. android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224)
      7. android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197)
      7 frames
    9. com.android.layoutlib
      ResourceHelper.getDrawable
      1. com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:316)
      1 frame
    10. Android Platform
      Resources.getDrawable
      1. android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:142)
      2. android.content.res.Resources.getDrawable(Resources.java:763)
      2 frames
    11. Android v7
      ResourcesWrapper.getDrawable
      1. android.support.v7.widget.ResourcesWrapper.getDrawable(ResourcesWrapper.java:133)
      1 frame
    12. Android Platform
      Context.getDrawable
      1. android.content.Context.getDrawable(Context.java:525)
      1 frame
    13. Android Support v4
      ContextCompat.getDrawable
      1. android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)
      2. android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:352)
      2 frames
    14. Android v7
      AppCompatCheckBox.<init>
      1. android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
      2. android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:181)
      3. android.support.v7.widget.AppCompatCompoundButtonHelper.loadFromAttributes(AppCompatCompoundButtonHelper.java:64)
      4. android.support.v7.widget.AppCompatCheckBox.<init>(AppCompatCheckBox.java:61)
      5. android.support.v7.widget.AppCompatCheckBox.<init>(AppCompatCheckBox.java:54)
      5 frames
    15. Java RT
      Constructor.newInstance
      1. sun.reflect.GeneratedConstructorAccessor363.newInstance(Unknown Source)
      2. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      3. java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      3 frames
    16. JetBrains android
      ViewLoader.loadView
      1. org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:465)
      2. org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
      3. org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
      3 frames
    17. com.android.tools
      LayoutlibCallbackImpl.loadView
      1. com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
      1 frame
    18. Android Platform
      LayoutInflater.inflate
      1. android.view.BridgeInflater.loadCustomView(BridgeInflater.java:312)
      2. android.view.BridgeInflater.onCreateView(BridgeInflater.java:141)
      3. android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
      4. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
      5. android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:210)
      6. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
      7. android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
      8. android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
      9. android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
      10. android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
      11. android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
      12. android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
      13. android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
      14. android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
      15. android.view.LayoutInflater.inflate(LayoutInflater.java:518)
      16. android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      16 frames
    19. com.android.layoutlib
      Bridge.createSession
      1. com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:317)
      2. com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
      2 frames
    20. com.android.tools.sdk-common
      LayoutLibrary.createSession
      1. com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
      1 frame
    21. com.android.tools
      RenderTask$2.compute
      1. com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
      2. com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
      2 frames
    22. IDEA
      ApplicationImpl.runReadAction
      1. com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
      1 frame
    23. com.android.tools
      RenderTask.lambda$inflate$61
      1. com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
      2. com.android.tools.idea.rendering.RenderTask.lambda$inflate$61(RenderTask.java:659)
      2 frames