Getting :
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
build.gradle file as below
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()
}
App level build.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')
}
What might be the issue?
EDIT
Below is the complete stacktrace of error :
Executing tasks: [:app:assembleDebug] in project /home/jaiminmodi/StudioProjects/skyazul-android
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:checkDebugAarMetadata FAILED
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:mergeDebugResources FAILED
Task :app:packageDebugResources UP-TO-DATE
Task :app:parseDebugLocalResources UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugMainManifest FAILED
Task :app:mergeDebugShaders UP-TO-DATE
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets FAILED
Task :app:processDebugJavaRes NO-SOURCE
Task :app:mergeDebugJavaResource FAILED
Task :app:checkDebugDuplicateClasses FAILED
Task :app:desugarDebugFileDependencies FAILED
Task :app:mergeDebugJniLibFolders UP-TO-DATE
Task :app:mergeDebugNativeLibs FAILED
Task :app:validateSigningDebug UP-TO-DATE
Task :app:writeDebugAppMetadata UP-TO-DATE
Task :app:writeDebugSigningConfigVersions UP-TO-DATE
FAILURE: Build completed with 8 failures.
1: Task failed with an exception.
- What went wrong:
Execution failed for task ‘:app:checkDebugAarMetadata’.
Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’.
Cannot resolve external dependency androidx.appcompat:appcompat:1.4.2 because no repositories are defined.
Required by:
project :app
Cannot resolve external dependency com.squareup.retrofit:retrofit:1.9.0 because no repositories are defined.
Required by:
project :app
Cannot resolve external dependency com.android.support:cardview-v7:23.2.1 because no repositories are defined.
Required by:
project :app
Cannot resolve external dependency com.squareup.retrofit:converter-jackson:1.9.0 because no repositories are defined.
Required by:
project :app
Cannot resolve external dependency com.squareup.okhttp:okhttp:2.0.0 because no repositories are defined.
Required by:
project :app
Cannot resolve external dependency com.squareup.okhttp3:logging-interceptor:2.2.0 because no repositories are defined.
Required by:
project :app
- Try:
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.
- Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:checkDebugAarMetadata’.
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at
2
Answers
First thing that comes to my mind is that a dependency you provided in the app level build.gradle file is not supported or couldn’t be found. Can you provide the rest of the error log? Another possible problem might be with the gradle version specified within the project. Try downgrading that if the above suggestion doesn’t work.
I just go through your problem and recommend you to try mavencentral() with google maven at your app level Gradle file, I hope it will work for you.