skip to Main Content

Unable to load class ‘org.gradle.api.publication.maven.internal.MavenPomMetaInfoProvider’.

apply plugin: ‘com.github.dcendents.android-maven’

The following were changes done in app after gradle update in gradle/wrapper/gradle-wrapper.properties

-distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip
+distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip

and under build.gradle

-        classpath 'com.android.tools.build:gradle:4.2.2'
+        classpath 'com.android.tools.build:gradle:7.0.0'

-        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
+        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'

Adding app level build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        kotlin_version = '1.5.10'
    }
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

    }
}

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

3

Answers


  1. After I made the upgrade to Artic Fox, I had to set the proper SDK for gradle in settings for things to work. By default after the update, it was still using Java 1.8, although JAVA_HOME was set properly and I had issues when applying com.android.application plugin.

    Also, I removed all the JVM target params from gradle files

    Gradle Settings

    Login or Signup to reply.
  2. The maven plugin hase been removed from Gradle 7 . Check the documentation .
    Now you should use maven-publish plugin , to activate it add

    plugins {
        id 'maven-publish'
    }
    

    or

    apply plugin: 'maven-publish'

    in your build script, instead using apply plugin: 'com.github.dcendents.android-maven'

    Otherwise you have to roll back to older Gradle version.

    Login or Signup to reply.
  3. Can you switch your,

    classpath 'com.android.tools.build:gradle:7.0.0'
    

    to,

    classpath 'com.android.tools.build:gradle:4.2.0' // or 4.2.2
    

    According to Gradle Plugin Release Notes I cannot see 7.0.0 listed there.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search