找不到匕首-2.13-2.13.jar(com.google.dagger:匕首:2.13)
我正在尝试使用匕首开发我的第一个Android应用程序,但是在编译它时遇到了一些麻烦。
当我编译项目时,控制台显示以下错误:
org.gradle.internal.resolve.ArtifactNotFoundException:
Could not find dagger-2.13-2.13.jar (com.google.dagger:dagger:2.13).
我认为问题是在Gradle配置中我的等级文件版本只有2.13。
我的gradle文件是:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
defaultConfig {
applicationId "co.megusta.countries"
minSdkVersion 16
targetSdkVersion 30
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
}
kotlinOptions {
jvmTarget = '1.8'
}
}
def lifeCycleExtensionsVersion = "1.1.1"
def supportVersion = "28.0.0"
def retrofitVersion = "2.3.0"
def daggerVersion = "2.13"
def glideVersion = "4.8.0"
def mockitoVersion = "2.11.0"
def rxJavaVersion = "2.0.1"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger:dagger-android-processor:$daggerVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "android.arch.lifecycle:extensions:$lifeCycleExtensionsVersion"
testImplementation 'junit:junit:4.+'
testImplementation "org.mockito:mockito-inline:$mockitoVersion"
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
stacktrace是:
* What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
> Could not resolve all files for configuration ':app:_agp_internal_javaPreCompileDebug_kaptClasspath'.
> Could not find dagger-2.13-2.13.jar (com.google.dagger:dagger:2.13).
Searched in the following locations:
https://jcenter.bintray.com/com/google/dagger/dagger/2.13/dagger-2.13-2.13.jar
有人知道我在做什么错吗?
谢谢。
I'm trying to develop my first Android app using Dagger, but I'm having some trouble compiling it.
When I compile the project, the console shows the error below:
org.gradle.internal.resolve.ArtifactNotFoundException:
Could not find dagger-2.13-2.13.jar (com.google.dagger:dagger:2.13).
I think that the problem is in Gradle configuration because the project try's to sync a package with the version duplicated dagger-2.13-2.13.jar
but in my grade file the version is only 2.13.
My gradle file is:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
defaultConfig {
applicationId "co.megusta.countries"
minSdkVersion 16
targetSdkVersion 30
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
}
kotlinOptions {
jvmTarget = '1.8'
}
}
def lifeCycleExtensionsVersion = "1.1.1"
def supportVersion = "28.0.0"
def retrofitVersion = "2.3.0"
def daggerVersion = "2.13"
def glideVersion = "4.8.0"
def mockitoVersion = "2.11.0"
def rxJavaVersion = "2.0.1"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
implementation "com.google.dagger:dagger:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger:dagger-android-processor:$daggerVersion"
implementation "com.android.support:recyclerview-v7:$supportVersion"
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "android.arch.lifecycle:extensions:$lifeCycleExtensionsVersion"
testImplementation 'junit:junit:4.+'
testImplementation "org.mockito:mockito-inline:$mockitoVersion"
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
The stacktrace is:
* What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
> Could not resolve all files for configuration ':app:_agp_internal_javaPreCompileDebug_kaptClasspath'.
> Could not find dagger-2.13-2.13.jar (com.google.dagger:dagger:2.13).
Searched in the following locations:
https://jcenter.bintray.com/com/google/dagger/dagger/2.13/dagger-2.13-2.13.jar
Anyone know what I'm doing wrong?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要解决此问题,我需要将Minsdk更新为21。之后,一切都按预期工作。
请参阅我的最终构建.gradle文件:
To fix this problem I need to update the minSdk to 21. After that everything works as expected.
See my final build.gradle file: