【问题标题】:Rendering error when changing theme更改主题时出现渲染错误
【发布时间】:2016-03-29 02:22:54
【问题描述】:

我决定开始学习 android,但是从一开始,每当我尝试在 Android Studio 中更改主题时,都会收到以下渲染错误:

The following classes could not be instantiated:
- android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache)
- android.support.design.widget.AppBarLayout (Open Class, Show Exception, Clear Cache)
- android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache)

即使我不更改主题,当我删除默认的“Hello word”文本时,我也会收到此错误。当我运行 AVD 时,一切正常,但在预览工具中却没有。我已经阅读了几篇关于此的帖子,但没有一篇有效。

我试过了:

  1. 在styles.xml的主题名称前添加“Base”
  2. 降低 API
  3. 更新一些 SDK 工具
  4. 使用与 API 相同的项目 (23) 版本。

【问题讨论】:

    标签: android xml android-studio android-design-library


    【解决方案1】:

    选择 Empty Activity 而不是空白 Activity 可以解决问题。

    【讨论】:

      猜你喜欢
      • 2016-01-25
      • 2017-12-18
      • 2023-03-16
      • 2020-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 2017-09-05
      相关资源
      最近更新 更多