How to import AnyChart-Android to Android studio

Viewed 1268

Good afternoon,

First of all, sorry for my knowledge of Android, which is extremely basic. I would assume my question is extremely simple, but yet, I have tried with all my effort and haven't succeeded, for which I would appreciate some help.

In the last days I have been trying to import the AnyChart-Android library for an application I am developping. According to their "README.md" file found on their Github page (https://github.com/AnyChart/AnyChart-Android), to use the library I should:

  • Add this maven { url 'https://jitpack.io' } into the allproject->repositories from the root build.gradle file.
  • Add the implementation 'com.github.AnyChart:AnyChart-Android:1.1.2' into the project build.gradle

Then, they claim that I should import a .JAR or .AAR file from their package, but it is unexistent...

Instead, I tried to import the package as import gradle project, but I couldn't manage to succeed in the import, and the error I got was:

Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'com.github.dcendents.android-maven' not found.

Could anyone please help me understand what I am doing wrong, or which steps should I follow to import this library?

I am working with Android Studio environment, if it is of any help this information.

Thank you very much in advance

1 Answers

Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'com.github.dcendents.android-maven' not found.

You forgot to add below in your App level build.gradle section.

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

Demo

 buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

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