无法在Android上编译showcaseview库

时间:2016-04-04 12:58:44

标签: android-studio android-gradle build.gradle android-library showcaseview

我试图在Android Studio上的项目中使用ShowcaseView项目,但无法构建项目。

展示链接:https://github.com/amlcurran/ShowcaseView

我已经包含以下内容:

在app / build.gradle中 -

compile 'com.github.amlcurran.showcaseview:library:5.4.1' 

在build.gradle中 -

repositories 
{
mavenCentral()
}

我收到以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve com.github.amlcurran.showcaseview:library:5.4.1.
     Required by:
         BLEDemo:app:unspecified
      > Could not resolve com.github.amlcurran.showcaseview:library:5.4.1.
         > Could not get resource 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.4.1/library-5.4.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.4.1/library-5.4.1.pom'.
               > Connection to https://jcenter.bintray.com refused

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

我已经在网上尝试了几项建议,但无法找到解决方案。

我还尝试导入库,在settings.gradle中包含它并得到错误。

有些人可以帮助我。

提前谢谢。

2 个答案:

答案 0 :(得分:1)

It looks like gradle is searching for the library in jCenter. If you add jCenter to your repositories closure does it work? Like this:

repositories 
{
    mavenCentral()
    jCenter()
}

答案 1 :(得分:0)

您的环境中是否有使用的代理服务器?如果是:使用您的用户和密码进行配置。构建找不到包,它位于github上并且因错误而中断。 如果您想了解更多如何执行此操作,可以查看此答案:gradle-behind-proxy-in-android-studio-1-3