Класс android.support.design.widget не найден - PullRequest
1 голос
/ 28 июня 2019

Я сталкиваюсь с этой ошибкой в ​​Android Studio:

Следующие классы не найдены:

- android.support.design.widget.FloatingActionButton (исправить путь сборки, изменить XML, создать класс) - android.support.design.widget.TextInputLayout (исправить путь сборки, изменить XML, создать класс)

Вот зависимости моего файла build.gradle:

dependencies {
        compile 'com.firebaseui:firebase-ui:0.6.0'
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'androidx.appcompat:appcompat:1.0.2'
        implementation 'com.google.firebase:firebase-core:17.0.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'com.google.firebase:firebase-messaging:17.3.4'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test:runner:1.2.0'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
        implementation 'com.google.android.gms:play-services-location:16.0.0'
        implementation 'com.google.firebase:firebase-auth:18.0.0'
        implementation 'com.google.android.material:material:1.0.0'
        implementation 'com.google.firebase:firebase-database:18.0.0'
        implementation 'com.android.support:design:27.1.1'
    }

Я пытался добавить com.android.support: design в файл Gradle, но это все еще не решило мою проблему

Ответы [ 2 ]

1 голос
/ 28 июня 2019

Я вижу, что вы используете артефакты AndroidX.Если вы используете AndroidX, другие зависимости должны быть и AndroidX!

до AndroidX:

com.android.support:design

AndroidX:

com.google.android.material:material:1.0.0-rc01

Вы также можете проверить здесь , чтобы увидеть аналог AndroidX предыдущегоартефакты

1 голос
/ 28 июня 2019

Попробуйте:

com.google.android.material:material:1.0.0-rc01

вместо

com.android.support:design
...