我安装了Android Studio,打开时出现以下错误
渲染问题无法实例化以下类 android.support.design.widget.FloatingActionButton (...)
我已经阅读了几个论坛并尝试了不同的版本,但问题仍然存在。
Android Studio version: 2.0 beta 6
SDK: Android 6.0 API 23 revision 2
如果您能帮助我,我将不胜感激
我认为安卓工作室测试版 6 在正确渲染 FAB 时遇到了问题。这并不意味着构建/运行可能会失败,它可能只是一个工作室/GUI 错误。
首先(如果您需要 gui 并且不需要晶圆厂)单击选项卡"文本"(底部"设计"旁边)并删除以下代码以删除呈现错误:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" />
最后回到设计。
(也许你不应该使用工作室的金丝雀更新频道并进入稳定版以避免获得测试版)
希望这有帮助
open your build.gradle (Module: app) file and change the version
buildToolsVersion "23.x.x" to buildToolsVersion "23.0.1" also change
the version of dependencies :-
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
than rebuild the project....
That's it. :)