我创建了一个空白的android项目,效果很好,但当我试图使用github上的这个库时,我发现了这个错误.
failed org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.miguelcatalan:materialsearchview:1.4.0.
org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.miguelcatalan:materialsearchview:1.4.0.
当我使用任何github库,但google库编译没有问题时,就会出现错误.请问我该怎么办?
这是我的身材.格拉德尔
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.myapplication"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//implementation 'com.google.android.material:material:1.4.0'
//implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-analytics:20.1.2'
implementation 'org.apache.commons:commons-text:1.6'
implementation 'com.github.ksoichiro:simplealertdialog:1.2.1@aar'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.7.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha02'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0' //Here is github Library
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
这是我的设置.格拉德尔
pluginManagement {
repositories {
maven {url 'https://jitpack.io'}
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {url 'https://jitpack.io'}
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include ':app'
我不知道我做错了什么.我真的被卡住了我不能使用github库