【问题标题】:Failed to apply plugin Android Studio应用插件 Android Studio 失败
【发布时间】:2015-06-28 21:05:27
【问题描述】:

我正在尝试将 ExoPlayer 库导入到我的 Android Studio 项目中。我用几种方法尝试了几次(直接用 GRADLE 导入),作为模块导入,复制粘贴,我得到同样的错误:

Error:(15) A problem occurred evaluating project ':..:ExoPlayer:library'.
> Failed to apply plugin [id 'bintray-release']
   > Plugin with id 'bintray-release' not found.

在库 gradle 中我找到了应用插件行:

apply plugin: 'bintray-release'

搜索库并将其应用于依赖项后,我仍然收到错误:

dependencies {
    compile 'com.novoda:bintray-release:0.2.10'
}

任何想法我该如何解决这个问题?

【问题讨论】:

    标签: android bintray


    【解决方案1】:

    看起来 gradle 在所有指定的存储库中都找不到这个插件。 ExoPlayer 在根项目中指定 buildscript 存储库,因此您也应该这样做。

    在您的根目录build.gradle 中确保buildscript 部分包含jcenter() 存储库和'andcom.novoda:bintray-release:0.2.7' 类路径:

    buildscript {
        repositories {
            ...... <- whatever you have now
            jcenter() <- make sure this one is there
        }
        dependencies {
            ...... <- whaterver you have now
            classpath 'com.novoda:bintray-release:0.2.7' <- make sure this one is there
        }
    }
    

    【讨论】:

    • 是的,这就是问题所在,但很愚蠢,如果我在库 gradle 中有,为什么我应该在主项目 gradle 中有它,但是,很高兴知道,谢谢!
    • 你是对的 - 这应该在库的 gradle 配置文件中。随时向 ExoPlayer 项目提交合并请求
    • 在我的情况下它仍然给出错误。放上这条线后,我该怎么办?
    • @PavelDudka 请更新答案.. 它不工作.. 添加这个最新的依赖项后,只有我的问题解决了 classpath 'com.novoda:bintray-release:0.3.4'
    • 现在我得到“错误:(23, 0) 解决后无法更改配置 ':..:ExoPlayer:classpath' 的依赖关系。”某人可以帮助我吗?
    猜你喜欢
    • 2021-10-09
    • 1970-01-01
    • 2016-01-06
    • 2017-12-04
    • 1970-01-01
    • 2018-03-16
    • 2018-05-13
    • 1970-01-01
    • 2015-12-19
    相关资源
    最近更新 更多