Android Studio Designer could not find class

I have a very strange problem.

I am using this library to add material design elements such as floating point buttons.

Everything worked well, but suddendly the Android Studio developer started warning me that it com.gc.materialdesign.view.ButtonFloat

couldn't find:

enter image description here

When I go to ButtonFlat

, the designer asks me to change to ButtonFloat

, etc.

The strange thing is that in my XML the class is known and there is no error.

enter image description here

Additions, buttons display perfectly in the emulator:

enter image description here

The problematic part of the code is this:

<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" />

      

My build.gradle for this module:

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'
}

      

This is very annoying. I tried to clean and build the project several times. Do you have any ideas? Thank you in advance.

+3


source to share


1 answer


Sometimes android studio is unable to display native layout tag. At that time, I need to close the project and close android studio. Then reopen again. This works for me.



0


source







All Articles