3

I am facing with following issue while updating android studio 3.0.1 to 3.1

Could not find android-maven-gradle-plugin.jar (com.github.dcendents:android-maven-gradle-plugin:1.5). Searched in the following locations: https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.5/android-maven-gradle-plugin-1.5.jar

Below is my build.gradle

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.novoda:bintray-release:0.3.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'io.fabric.tools:gradle:1.24.4'
    }
}

Please help

Tayyab Amin
  • 686
  • 10
  • 28
  • In the new ver. gradle 7.0.2 , see this link https://stackoverflow.com/a/70811778/12272687 – Mori Jan 22 '22 at 10:09

2 Answers2

3

Got solution, error resolved by updating

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

to

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

In gradle-wrapper.properties use this :

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

and update buildToolsVersion to 27.0.3

Tayyab Amin
  • 686
  • 10
  • 28
1

Gradle Android Maven plugin

To use the android-maven-gradle-plugin, just apply the plugin in your android-library project. Also add the plugin classpath dependency to the buildScript.

buildscript {
repositories {
    mavenCentral()
}

dependencies {
    classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

apply plugin: 'com.android.library'

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

OR use gradle 2.1

plugins {
 id "com.github.dcendents.android-maven" version "2.0"
}

You can set the maven groupId and version in the script build.gradle:

group = 'com.example'
version = '1.0'

set in settings.gradle:

rootProject.name = 'artifact'
Android Geek
  • 8,956
  • 2
  • 21
  • 35