Android Studio Designer找不到类

Android Studio Designer找不到类,android,android-studio,material-design,Android,Android Studio,Material Design,我面临一个非常奇怪的问题 我使用以添加材质设计元素,如浮动按钮 一切都很顺利,但Android Studio设计师突然开始警告我,找不到com.gc.materialdesign.view.ButtonFloat: 当我更改为ButtonFlat时,设计师要求更改为ButtonFloat,等等 奇怪的是,在我的XML中,类是已知的,并且没有错误 此外,这些按钮在模拟器中完美地显示: 有问题的代码如下所示: <com.gc.materialdesign.views.ButtonFloa

我面临一个非常奇怪的问题

我使用以添加材质设计元素,如浮动按钮

一切都很顺利,但Android Studio设计师突然开始警告我,找不到
com.gc.materialdesign.view.ButtonFloat

当我更改为
ButtonFlat
时,设计师要求更改为
ButtonFloat
,等等

奇怪的是,在我的XML中,类是已知的,并且没有错误

此外,这些按钮在模拟器中完美地显示:

有问题的代码如下所示:

<com.gc.materialdesign.views.ButtonFloat
    android:id="@+id/buttonFloatTakePicture"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_marginEnd="20dp"
    android:layout_marginTop="50dp"
    materialdesign:animate="true"
    materialdesign:iconDrawable="@mipmap/ic_photo"
    android:onClick="takePhoto" />

这很烦人。我多次尝试清理和构建该项目。你知道吗?提前感谢。

有时android studio无法正确显示自定义布局标签。那个时候,我需要关闭project,同时关闭android studio。然后,重新打开。它对我有用

repositories {
    jcenter()
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 22
    }
}

dependencies {
    compile 'com.github.navasmdc:MaterialDesign:1.+@aar'
    compile 'com.nineoldandroids:library:2.4.+'
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.android.support:recyclerview-v7:22.1.1'
    compile 'com.nineoldandroids:library:2.4.+'
    compile 'com.soundcloud.android:android-crop:0.9.10@aar'
}