Android Studio,渲染问题

时间:2016-02-28 21:30:36

标签: android android-layout widget

我刚刚安装了Android Studio但是当我开始时它告诉我:

渲染问题无法实例化以下类:

android.support.design.widget.FloatingActionButton (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    android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029 
at android.content.res.Resources.getResourceName(Resources.java:2235)  
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602)     at android.content.res.Resources.loadDrawable(Resources.java:2540)   
at android.content.res.Resources.getDrawable(Resources.java:806)   
at android.content.Context.getDrawable(Context.java:458)   
at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)   
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:321)      
at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:180)   
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:70)   
at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:39)   
at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:65)   
at android.support.design.widget.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:37)  
at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:109)   
at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105)   
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)   
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)     
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)   
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)     at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)   
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)    
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)   
at android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy stack to clipboard 

我该怎么办?

1 个答案:

答案 0 :(得分:1)

仅更新SDK可以解决问题。您可以通过Android studio更新SDK-&gt;帮助 - &gt;检查更新 - &gt;然后单击立即更新或打开SDK文件夹并手动运行'SDK Manager.exe'并更新所有可用的SDK更新。有时Android工作室会更新,但SDK不会。手动更新SDK。 (在桌面上保留'SDK Manager.exe'的快捷方式将是一个有用的提示。)