get:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
构建。gradle文件如下
buildscript {
ext {
agp_version = '7.2.1'
gms_version = '4.3.13'
kotlin_version = '1.7.0'
crashlytics_version = '2.8.1'
}
repositories {
google()
}
}
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'com.google.gms.google-services' version "$gms_version" apply false
id 'com.google.firebase.crashlytics' version "$crashlytics_version" apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
repositories {
google()
}
应用程序级别构建。gradle:
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.brian.skyazul"
minSdk 30
targetSdk 32
versionCode 3
versionName "1.2"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
lintOptions {
checkReleaseBuilds false
}
/* kotlinOptions {
jvmTarget = '1.8'
}*/
}
dependencies {
implementation 'com.google.android.material:material:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:23.2.1'
implementation 'com.squareup.retrofit:converter-jackson:1.9.0'
implementation 'com.squareup.okhttp:okhttp:2.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:2.2.0'
implementation files('libs/picasso-2.5.2.jar')
}
可能是什么问题?
编辑
下面是错误的完整堆栈跟踪:
在project/home/jaiminmodii/studioprojects/skyazul-android中执行任务:[:app:assembleDebug]
任务:app:preBuild - updated任务:app:preDebugBuild任务:app:mergeDebugNativeDebugMetadata NO-SOURCE任务:app:compileDebugAidl NO-SOURCE任务:app:compileDebugRenderscript任务:app:generateDebugBuildConfig - updated任务:app:javaPreCompileDebug任务:app:checkDebugAarMetadata FAILED任务:app:generateDebugResValues updated任务:app:generateDebugResources任务:app:mergeDebugResources FAILED任务:app:packageDebugResources已更新任务:app:parseDebugLocalResources任务:app: createdebugcompatiblescreenmanifest - updated任务:app:extractDeepLinksDebug任务:app:processDebugMainManifest FAILED任务:app:mergeDebugShaders: updated任务:app:compileDebugShaders NO-SOURCE任务:app:generateDebugAssets已更新任务:app:mergeDebugAssets FAILED任务:app:processDebugJavaRes NO-SOURCE任务:app:mergeDebugJavaResource FAILED任务:app: checkdebugduplicateclass FAILED任务:app:desugarDebugFileDependencies FAILED任务:app:mergeDebugJniLibFolders已更新任务:app:mergeDebugNativeLibs FAILED任务:app:validateSigningDebug任务:app:writeDebugAppMetadata - updated任务:app:writeDebugSigningConfigVersions - up
FAILURE: Build completed with 8 failed .
1: Task failed with an exception.
- 哪里出错了:任务':app:checkDebugAarMetadata'执行失败。
无法解析配置':app:debugRuntimeClasspath'的所有文件。无法解决外部依赖androidx.appcompat:appcompat:1.4.2,因为没有定义存储库。要求:项目:应用程序无法解决外部依赖com.squareup.retrofit:retrofit:1.9.0,因为没有定义存储库。要求:项目:应用程序无法解决外部依赖com.android.support:cardview-v7:23.2.1,因为没有定义存储库。要求:项目:应用程序无法解决外部依赖com.squareup.retrofit:converter-jackson:1.9.0,因为没有定义存储库。要求:项目:应用程序无法解析外部依赖com.squareup.okhttp:okhttp:2.0.0,因为没有定义存储库。要求:项目:应用程序无法解决外部依赖com.squareup.okhttp3:logging-interceptor:2.2.0,因为没有定义存储库。要求:项目:应用
- 试题:
使用——info或——debug选项运行以获得更多日志输出。运行——scan以获得完整的见解。
- 异常:org.gradle.api.tasks.TaskExecutionException:任务':app:checkDebugAarMetadata'执行失败。在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute (CatchExceptionTaskExecuter.java: 38)org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter executetask 1.美元(EventFiringTaskExecuter.java: 77)org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.调用(EventFiringTaskExecuter.java: 55)在org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter 1.美元调用(EventFiringTaskExecuter.java: 52)org.gradle.internal.operations.DefaultBuildOperationRunner CallableBuildOperationWorker.execute美元(DefaultBuildOperationRunner.java: 204)org.gradle.internal.operations.DefaultBuildOperationRunner CallableBuildOperationWorker.execute美元(DefaultBuildOperationRunner.java: 199)在执行org.gradle.internal.operations.DefaultBuildOperationRunner 2.美元(DefaultBuildOperationRunner.java: 66)org.gradle.internal.operations.DefaultBuildOperationRunner执行2.美元(DefaultBuildOperationRunner.java: 59)org.gradle.internal.operations.DefaultBuildOperationRunner.execute (DefaultBuildOperationRunner.java: 157)org.gradle.internal.operations.DefaultBuildOperationRunner.execute (DefaultBuildOperationRunner.java: 59)在
我想到的第一件事是你在应用程序级别提供的依赖build.gradle文件不受支持或找不到。您能提供错误日志的其余部分吗?另一个可能的问题可能与项目中指定的gradle版本有关。如果上面的建议不起作用,试着降级。
我只是通过你的问题,并建议你尝试mavencentral()与谷歌maven在你的应用级Gradle文件,我希望它会为你工作。
repositories {
maven {
url "https://maven.google.com"
}
mavenCentral()
}