如何使用 gradle 从 jitpack.io 导入库?

How to import library from jitpack.io using gradle?

我尝试关注 these instructions,所以我的 build.gradle(应用程序)的相关部分如下所示:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://jitpack.io' }
    }

compile 'com.github.qiugang:EditTag:v1.2.3'

但 Android Studio 仍然显示此错误消息:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not find com.github.qiugang:EditTag:v1.2.3.
     Required by:
         myapp-yeah:app:unspecified

您修改了 buildscript。说明显示更改 allprojects

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

buildscript 用于 Gradle 插件,这个库显然不是 Gradle 插件。