如何将AnyChart-Android导入到Android Studio

3
下午好,
首先,对于安卓方面的知识我了解甚少,我的问题可能非常简单,但是尽管如此,我已经努力尝试过了,但是一直没有成功。因此,我会很感激您的帮助。
最近几天,我一直在尝试为我正在开发的应用程序导入AnyChart-Android库。 根据他们在Github页面上的“README.md”文件(https://github.com/AnyChart/AnyChart-Android)中的说明,要使用该库,我应该:
  • 将此maven{url'https://jitpack.io'}添加到根build.gradle文件的allproject->repositories。
  • 将implementation 'com.github.AnyChart:AnyChart-Android:1.1.2'添加到项目build.gradle中
然后,他们声称我应该从他们的软件包中导入一个.JAR或.AAR文件,但是它不存在...
相反,我试图将包作为gradle项目导入,但我无法成功导入,并且我得到的错误是:

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

请问有谁可以帮助我理解我做错了什么,或者我应该遵循哪些步骤来导入此库?
我正在使用Android Studio开发环境,如果这有任何帮助的话。
非常感谢您提前的帮助。
1个回答

1
由于:org.gradle.api.plugins.UnknownPluginException:未找到ID为'com.github.dcendents.android-maven'的插件。
你忘记在应用级别的build.gradle部分中添加以下内容。
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

演示

 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
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接