无法解析配置“:app:debugRuntimeClasspath”的所有文件。错误
我已经将我的 android studio 升级到最新版本(bumblebee)并打开了一个新项目。我尝试实现我过去使用过的库:
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
但我收到了此错误: 引起原因:org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:无法解析配置“:app:debugRuntimeClasspath”的所有文件。
每当我删除实现时,错误就会消失。该实现适用于在以前的 android studio 版本上创建的项目,那么为什么它不适用于最新版本呢?
这是我的项目 build.grade:
buildscript {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.google.gms:google-services:4.3.10'
}
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的应用程序 build.gradle:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.example.nobook"
minSdk 24
targetSdk 31
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 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-database:20.0.4'
implementation 'com.google.firebase:firebase-auth:21.0.2'
implementation 'com.google.firebase:firebase-storage:20.0.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation platform('com.google.firebase:firebase-bom:29.0.4')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
I've upgraded my android studio to the latest version (bumblebee) and opened a new project. I tried implementing a library I've used in the past:
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
but I've been getting this error:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Whenever I remove the implementation the error disappears. the implementation works on projects created on previous android studio version so why doesn't it work on the latest one?
this is my project build.grade:
buildscript {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.google.gms:google-services:4.3.10'
}
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is my app build.gradle:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.example.nobook"
minSdk 24
targetSdk 31
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 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-database:20.0.4'
implementation 'com.google.firebase:firebase-auth:21.0.2'
implementation 'com.google.firebase:firebase-storage:20.0.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation platform('com.google.firebase:firebase-bom:29.0.4')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论