Could not get resource 'https://repo.maven.apache.org/maven2/com/github/dcendents/android-maven-gradle-plugin/1.5/android-maven-gradle-plugin-1.5.jar'

Getting this error while running cordova build android.

My build.gradle file under cordovaLib folder is given below

buildscript {
    repositories {
        google()
        //jcenter()
        //mavenCentral()
        //maven { url 'http://plugins.gradle.org/m2/' }
        //maven { url 'http://groovy.jfrog.io/artifactory/libs-release/' }
        mavenCentral()
        maven { url 'https://jitpack.io/' }
        //maven{url 'https://mirrors.cloud.tencent.com/repository/maven/'}
        //maven{url 'https://repo1.maven.org/maven2/com/github/dcendents/'}
        // maven {
        //     url "https://maven.google.com"
        // }
        //maven { url 'https://repo.grails.org/grails/core/' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        //classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

I’ve checked .gradle cache no jar file is created.
Thanks in Advance

I’m using gradle distribution of gradle-4.6-all

Please never anywhere share screenshots of text if you only want to share the text and not something additional like colors or IDE annotations. Text in images is hard to read, especially on mobile, very hard to copy, and nearly impossible to search for.

Regarding your question, besides the various bad practices you use and the ancient Gradle version, the error message most probably means that either your Java installation is corrupt, or you are attacked by a man-in-the-middle attack, or you connect through some proxy that is returning with a foreign HTTPS certificate.

You can start with javax.net.ssl debug output to get more and exact information, but it needs some experience to interpret those logs.

Thanks for the reply. This makes sense as there is client proxy which has been used in background for every hit I’ve raised the request to bypass (https://repo.maven.apache.org/) it’ll take time for approval. Actually this is basically happening because I’ve changed my system in my previous system under .gradle/ cache modules-2\files-2.1 this jars are there but I cant use those jar because of the path and user change in my new system(its company created). The path in the resource-at-url bin file of the old system cache location mismatch with new location with my new system. Do you have any workaround for it as I’m feeling distressed for this as the new jars download is getting blocked?

You could leave it in the old spot and use the GRADLE_USER_HOME environment variable to tell Gradle to use the user dir there instead of in your home directory.

Cant put it in old spot my username is different for the system so e.g the old path was users/1234/.gradle/cache and in new system user OHR users/1222. and the OHR is maintained by it team so can’t use or point the old user that is the challenge.

Well, not everything in the Gradle user home is relocatable, but the dependency cache indeed should be. Maybe you need to just keep some files, but not others. See also Dependency Caching

as the cache cant restored I’m using local folder to copy the jars for temporary basis for plugin jars

repositories{
    jcenter()
    maven { url "https://jitpack.io" }
    flatDir {
     dirs 'src/main/libs'
   }
}

dependencies {
    //compile 'com.github.ergovia-mobile:android-transcoder:v0.1.10R_ergovia'
    compile(name:'android-transcoder-v0.1.10R_ergovia', ext:'aar')
}

e.g android-transcoder-v0.1.10R_ergovia.aar under ‘src/main/libs’ and the build is working fine. Is it fine?

Depends on whom you ask. :smiley:
I generally dislike having libs in VCS, unless absolutely necessary because it is not avaliable in any repository or similar.
But when really needing to use local libs, then yes, a flatDir repository is the best way to handle it.