Denny Mathew
Denny Mathew

Reputation: 853

Android Studio Arctic Fox : after update gradle error

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
}

Upvotes: 6

Views: 4058

Answers (3)

Alish Giri
Alish Giri

Reputation: 2238

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.

Upvotes: 2

Zahid Islam
Zahid Islam

Reputation: 740

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.

Upvotes: 1

Cristian Holdunu
Cristian Holdunu

Reputation: 1918

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

Upvotes: 2

Related Questions