Home > Back-end >  gradle says it fails to build because it couldnt find all files?
gradle says it fails to build because it couldnt find all files?

Time:09-15

im trying to build this but it fails and i have searched and tried the solutions that worked for peule with similar issues but nothing worked. i am following course in kotlin/android and there every thing works link to the course:https://www.youtube.com/watch?v=BBWyXo-3JGQ&t=2938s

this is the local build.gradle

    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-android-extensions'
}

android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.example.todolist"
        minSdkVersion 21
        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'
    }
}

dependencies {
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation 'com.google.android.material:material:1.3.0-alpha02'
}

and it returns this:



> Configure project :app
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

> 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: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:javaPreCompileDebug UP-TO-DATE
> 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: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 7 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'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

5: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

6: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

7: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.volley:volley:1.1.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
       - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
     Required by:
         project :app

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 479ms
19 actionable tasks: 7 executed, 12 up-to-date

CodePudding user response:

It looks like the current version is 1.2.1 and 1.1.1 is not available. Update the dependencies in your build.gradle like this:

implementation 'com.android.volley:volley:1.2.1'
  • Related