-3

I have implemented phone number detection and SMS verification functionality into my project by referring to this project https://www.programcreek.com/java-api-examples/?code=android%2Fidentity-samples%2Fidentity-samples-master%2FSmsVerification%2Fapp%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fsamples%2Fsmartlock%2Fsms_verify%2Fui%2FPhoneNumberActivity.java#

I downloaded and imported volley from the link below https://github.com/google/volley

I am getting an error while building my project, please guide me I am new to android studio...

Error

Unable to find method 'org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.getPublishableFiles()Lorg/gradle/api/file/FileCollection;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Update: I deleted gradle file from C:\Users\MY PC.gradle\wrapper\dists and rebuilt the project and now I am getting this error

Error Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle. Enable Gradle 'offline mode' and sync project Learn about configuring HTTP proxies in Gradle

Vipin Chouhan
  • 120
  • 10
  • does this [link](https://stackoverflow.com/questions/38442901/gradles-dependency-cache-may-be-corrupt-this-sometimes-occurs-after-a-network) can solve your answer? – Jyotish Biswas Aug 19 '20 at 06:15

1 Answers1

0

change the distributionUrl in the gradle-wrapper.properties to distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip to get the build running again. This seems to be a similar problem Gradle sync failed: Unable to find method.