アプリ作成時にレイアウトファイルでRendering Problemsが出た時の対処
2196 ワード
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">
以上
Author And Source
この問題について(アプリ作成時にレイアウトファイルでRendering Problemsが出た時の対処), 我々は、より多くの情報をここで見つけました https://qiita.com/hisash1/items/ccf2973f6b5f9e6439dd著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .