Android 未能解析:com.github.mancj:MaterialSearchBar:0.8.2

Android 未能解析:com.github.mancj:MaterialSearchBar:0.8.2,android,github,Android,Github,我正在借助youtube视频构建一个android系统,当我尝试将其与fire base同步时,它显示以下错误 错误:未能解析:com.github.mancj:MaterialSearchBar:0.8.2 在“项目结构”对话框中显示 受影响模块:应用程序 这是我的密码 apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkV

我正在借助youtube视频构建一个android系统,当我尝试将其与fire base同步时,它显示以下错误

错误:未能解析:com.github.mancj:MaterialSearchBar:0.8.2

在“项目结构”对话框中显示

受影响模块:应用程序

这是我的密码

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.mynewrealtimelocationtracker"
        minSdkVersion 22
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Libraries
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.karumi:dexter:5.0.0'
    implementation 'com.firebaseui:firebase-ui-database:4.3.1'
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    implementation 'com.github.d-max:spots-dialog:1.1@aar'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.github.mancj:MaterialSearchBar:0.8.2'

    //RxJava2
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.7'

    //Retrofit2
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    implementation 'io.paperdb:paperdb:2.6'
}
如果有人能告诉我使用下面代码的目的,我会很高兴

implementation 'com.github.mancj:MaterialSearchBar:0.8.2'

因为我是android新手,所以我不知道上面的内容。

这是一个带有材质设计风格的搜索栏库

如果您没有在xml中使用它,那么您可以删除它。我建议您这样做,因为如果在删除它之后您仍然有编译错误,那么您就有了另一个被它掩盖的错误。只有在删除它并编译之后,您才能知道这是问题所在,并且可以开始修复它

最有可能的问题应该在这里讨论

Android API所需的库在名称上标明它,通常为
androidx
。我猜根本问题可能与您正在使用的大量库有关

如果您是Firebase新手,请转到文档并阅读RTD的基本示例,此代码实验室应该足够了


其余的库只是添加了额外的逻辑,这可能是一个很好的体系结构,但您不需要使用Rx来使用Firebase。还有其他一些值得怀疑的东西,例如使用paper db作为第二个数据库,如果项目已经在使用Firebase实时数据库,该怎么办?这是教程中的一个常见问题,我的建议是遵循文档,然后逐渐增加复杂性。

查看发布说明,并建议您使用最新的发布说明。

youtuber使用了一个材质搜索栏库来实现搜索栏。您的错误是库路径不存在。试着用谷歌搜索那个图书馆。如果现在仍然存在或版本已更改。是否已将jitpack添加到
build.gradle
的存储库部分?根据自述文件,你必须这样做才能获取工件。。。