2017-08-16 146 views
2

我已經開始了一個新的項目,但我不斷收到以下錯誤渲染:渲染錯誤Android Studio中

Rendering failed with a known bug. Please try a rebuild. The following classes could not be instantiated: 
- android.support.v7.widget.AppCompatImageView (Open Class, Show Exception, Clear Cache) 
- android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache) 
- android.support.v7.widget.Toolbar (Open Class, Show Exception, Clear Cache) 
- android.support.constraint.ConstraintLayout (Open Class, Show Exception, Clear Cache) 
- android.support.v7.widget.AppCompatTextView (Open Class, Show Exception, Clear Cache) 
- android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache) 
- 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. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.NoSuchFieldError: ViewBackgroundHelper   at android.support.v7.widget.AppCompatBackgroundHelper.loadFromAttributes(AppCompatBackgroundHelper.java:46)   at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:63)   at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:56)   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)   at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:95)   at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:52)   at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:46)   at com.android.layoutlib.bridge.impl.Layout.createNavBar(Layout.java:284)   at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:140) 

我使用的是最新的支持庫和gradle這個構建工具的最新版本,以及。我似乎無法讓渲染器工作。

+0

的可能的複製(https://stackoverflow.com/questions/44223687/ [Android Studio中3.0佈局編輯器渲染錯誤]渲染錯誤在安卓工作室3-0佈局編輯器) –

+0

@ XH6user我正在使用Android Studio 2.3.3 –

+0

您是否嘗試添加.Base主題?看起來像許多人一樣。 –

回答

0

能否請您在下面的代碼添加到grade.properties和重建項目

android.enableBuildCache=false