# Android studio error:Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.github.dcendents.android-maven'

**URL:** <https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707>\
**Category:** Help/Discuss\
**Created:** [June 15, 2024, 3:02am UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707 "2024-06-15T03:02:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justy36](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Justy36](https://discuss.gradle.org/u/Justy36)\
**Post date:** [June 15, 2024, 3:02am UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/1 "2024-06-15T03:02:28Z")

</div>

I used Android Studio,to import github project for practicing,when I tried to build project,error occured,

```plaintext
> Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.github.dcendents.android-maven'.

> Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'AndroidMavenPlugin'.

> Caused by: org.gradle.internal.instantiation.ClassGenerationException: Could not generate a decorated class for type AndroidMavenPlugin

```

This is project build.gradle:

```gradle
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.2.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
    }
}

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

```

this is my gradle-wrapper.properties

```gradle
#Fri Jun 07 10:47:48 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

```

I searched for method to resolve it,many answers were about grald-plugin not matched gradle,but I cound not find how to really solve it.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 15, 2024, 8:40am UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/2 "2024-06-15T08:40:02Z")

</div>

That plugin is 6 years old, making it compatible with Gradle 4.6 with that release. After that it was archived as the Android Gradle Plugin for the same functionality. So it is quite likely, that it simply is not compatible with Gradle 8.2.

---

<div class="post-metadata">

**Author:** ![Justy36](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Justy36](https://discuss.gradle.org/u/Justy36)\
**Post date:** [June 15, 2024, 1:06pm UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/3 "2024-06-15T13:06:17Z")

</div>

Thanks,it worked.But then when I go on,I download jdk1.8 to resolv below error:

> The project uses Gradle 4.6 which is incompatible with Java 11 or newer  
> and it worked,after that, a new error occured like below:

```gradle
Could not find com.android.tools.build:gradle:4.6.
Searched in the following locations:
    https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.6/gradle-4.6.pom
    https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.6/gradle-4.6.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.jar
    https://mirrors.cloud.tencent.com/repository/maven/com/android/tools/build/gradle/4.6/gradle-4.6.pom
    https://mirrors.cloud.tencent.com/repository/maven/com/android/tools/build/gradle/4.6/gradle-4.6.jar
Required by:
    project :
Add google Maven repository and sync project
Open File

```

and I trie modified my root build.gradle,added maven{…} like below code:

```gradle
buildscript {
    repositories {
        google()
        jcenter()
        **maven{url 'https://mirrors.cloud.tencent.com/repository/maven/'}**
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.6'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
    }
}

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

```

but it still could not work well,do you know the reason.

---

<div class="post-metadata">

**Author:** ![Justy36](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Justy36](https://discuss.gradle.org/u/Justy36)\
**Post date:** [June 15, 2024, 1:15pm UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/4 "2024-06-15T13:15:41Z")

</div>

I also have a question,why Gradle 4.6 is compatible with this project,I tried download 3.0 version and failed,could you tell me where I can find the compatible version in the web.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 15, 2024, 7:29pm UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/5 "2024-06-15T19:29:12Z")

</div>

`com.android.tools.build:gradle` is **not** the Gradle version. It is the Android Gradle Plugin that unfortunately called their artifact `gradle`, but it has nothing to with the Gradle version.

---

<div class="post-metadata">

**Author:** ![Justy36](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@Justy36](https://discuss.gradle.org/u/Justy36)\
**Post date:** [June 15, 2024, 11:31pm UTC](https://discuss.gradle.org/t/android-studio-error-caused-by-org-gradle-api-internal-plugins-pluginapplicationexception-failed-to-apply-plugin-com-github-dcendents-android-maven/48707/6 "2024-06-15T23:31:16Z")

</div>

Thaks，I will try it.
