gpt4 book ai didi

android - 渲染问题无法加载 LayoutLib :

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:59:36 24 4
gpt4 key购买 nike

渲染问题加载 LayoutLib 失败:com.android.layoutlib.bridge.Bridge(详情)

org.jetbrains.android.uipreview.RenderingException: Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge
at org.jetbrains.android.uipreview.LayoutLibraryLoader.load(LayoutLibraryLoader.java:90)
at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:180)
at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:166)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:475)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

screen

最佳答案

根据 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

我认为还可以通过 Canary channel 将您的 Android Studio 更新到 2.0 Beta 2 可能会解决问题。

如果仍然不起作用,请尝试在设备上运行您的应用 - 此处的布局是否显示正确?

您还可以阅读:Android Studio rendering problems

编辑:还要检查这些帖子中的解决方案:

在这篇文章中 Failed to load the LayoutLib: com.android.layoutlib.bridge.Bridge你会发现:

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.

关于android - 渲染问题无法加载 LayoutLib :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34260506/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com