I used Android Studio,to import github project for practicing,when I tried to build project,error occured,
> 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
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.
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:
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:
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.
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.