Rendering Problems Failed to load the LayoutLib:

前端 未结 2 1752
庸人自扰
庸人自扰 2021-02-14 22:08

Rendering Problems Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge (Details)

org.jetbrains.android.uipreview.RenderingException: Failed to load         


        
相关标签:
2条回答
  • 2021-02-14 22:46

    According to Layout preview rendering problems in android studio(Android Studio 1.2)

    Try changing your base application theme using below code - in res/values/styles.xml

    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>
    

    OR

    Also you can try Switching the preview's API level to lower one from the preview configuration

    enter image description here

    I think also updating your Android Studio to 2.0 Beta 2 by Canary channel might solve a problem.

    If still doesn't work try to run your app on device - is layout here displaying properly?

    You may also read this: Android Studio rendering problems

    EDIT: Check also solutions in these posts:

    In this post Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge you would find:

    Possibly Classes With Identical names inside different projects.

    I might know the issue. I just recreated a framework I made, and I called it number 2. A lot of the classes had the same name, and same method, inside packages of the same name. This seemed to really confuse the IDE and/or JRE.

    I was able to sort of fix the problem, by making sure they weren't both being imported inside the same project! It is still giving me strange warnings, but it seems to be working correctly. What I would ultimately suggest if this is the case, would be to remove the duplicates from the project all together.

    0 讨论(0)
  • 2021-02-14 22:58

    I am using Android Studio 1.5, and to solve this issue I change the API version from the default API 23: Android N (preview) to the API 23 Android 6.0 as shown in the image below.

    You might need to restart Android studio or not depending on your configurations.

    Hope it helps!!

    0 讨论(0)
提交回复
热议问题