无法应用插件Android Studio

Mar*_*vel 16 android bintray

我正在尝试将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.
Run Code Online (Sandbox Code Playgroud)

在库gradle中,我找到了apply plugin行:

apply plugin: 'bintray-release'
Run Code Online (Sandbox Code Playgroud)

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

dependencies {
    compile 'com.novoda:bintray-release:0.2.10'
}
Run Code Online (Sandbox Code Playgroud)

任何Ideea我怎么能解决这个问题?

Pav*_*dka 27

看起来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
    }
}
Run Code Online (Sandbox Code Playgroud)

  • @PavelDudka请更新答案..它不起作用..添加这个最新的依赖项后,我的问题解决了**classpath'com.novoda:bintray-release:0.3.4'** (3认同)
  • 是的,这就是问题所在,但是很愚蠢,如果我在库 gradle 中有它为什么我应该在主项目 gradle 中,但是,很高兴知道,谢谢! (2认同)