【问题标题】:how to include github repo in gradle when implementation or compile method cannot be found?当找不到实现或编译方法时,如何在 gradle 中包含 github repo?
【发布时间】:2019-05-25 02:19:43
【问题描述】:

我明白了:

在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到参数 [com.github.user:test:master] 的方法 implementation()。

我也尝试过compile,但出现同样的找不到方法compile()错误。

// Top-level build file where you can add configuration options 
common to all sub-projects/modules.
buildscript {
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    compile 'com.github.test:user:master'
}
}

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

【问题讨论】:

    标签: gradle


    【解决方案1】:

    基本上我必须在 build.gradle 中包含 mavenCentral()

    然后在 app.gradle 中,我在 android 块中添加了依赖项。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-24
      • 2022-01-16
      • 2015-03-11
      • 2015-03-12
      • 2015-05-08
      • 2019-07-26
      相关资源
      最近更新 更多