【问题标题】:Cannot compile showcaseview library on Android无法在 Android 上编译 showviewview 库
【发布时间】:2016-07-24 00:54:42
【问题描述】:

我正在尝试在我的 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 中,但出现错误。

请帮帮我。

提前谢谢你。

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 谢谢。我对这行代码代表什么有点困惑:[systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost] 你有什么想法吗?
    • 只需点击引用的链接:如果我理解正确,您必须在属性中更改这些行:docs.gradle.org/current/userguide/…
    • 不知道怎么改这一行:[systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost]
    • 试试 [systemProp.http.nonProxyHosts=localhost]
    【解决方案2】:

    看起来 gradle 正在 jCenter 中搜索库。如果您将 jCenter 添加到您的存储库闭包中,它会起作用吗?像这样:

    repositories 
    {
        mavenCentral()
        jCenter()
    }
    

    【讨论】:

    • 我试过你的方法,还是出现了同样的错误:/
    • 真的很奇怪。不知道是不是发布有问题。您可以尝试将版本更改为 5.4.3 吗?那个版本肯定已经发布了
    • 5.4.3 依赖不起作用(由于上面提到的 Kim 的代理猜测)但添加库有效!谢谢 :) 如果您不介意,您能再给我一些建议吗?我正在尝试在操作栏上展示,我看到很多帖子说 app compact 无法做到这一点。我似乎没有使用 app compact,所以你能给我解决这个问题吗?
    猜你喜欢
    • 1970-01-01
    • 2012-09-19
    • 2020-08-02
    • 1970-01-01
    • 1970-01-01
    • 2013-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多