26
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アプリ作成時にレイアウトファイルでRendering Problemsが出た時の対処

Posted at

Rendering Problemsの解決方法を簡単に記載する。

#環境
Android Studio 1.5.1

#エラー内容

アプリ作成時に以下のようなエラーが出る時があった。

Rendering Problems The following classes could not be instantiated:
- android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)
 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE  Exception Details java.lang.NullPointerException   at android.support.v7.app.WindowDecorActionBar.getDecorToolbar(WindowDecorActionBar.java:241)   at android.support.v7.app.WindowDecorActionBar.init(WindowDecorActionBar.java:198)   at android.support.v7.app.WindowDecorActionBar.<init>(WindowDecorActionBar.java:190)   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)   at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:89)   at com.android.layoutlib.bridge.impl.Layout.createActionBar(Layout.java:237)   at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:151) Copy stack to clipboard  Failed to find the style corresponding to the id 2147418176 (6 similar errors not shown) Failed to load AppCompat ActionBar with unknown error. (3 similar errors not shown)

#対処方法
res/values/style.xmlファイルを編集する。

以下の1行を

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

次のように変更する。

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

以上

26
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?