微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – gradle如何选择某些url来查找存储库?如何将其指向正确的方向以便我可以导入此JAR?

为了获取cwac-camera commonsware jar,我在build.grade中有这个:

dependencies {
    compile 'com.commonsware.cwac:camera:0.6.+'
}

当我尝试编译时,它给了我这个:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.commonsware.cwac:camera:0.6.12.
     Searched in the following locations:
         https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
         file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
         file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
     required by:
         Cwac4:app:unspecified

所以它在jcenter中查找,并在一堆我的主目录文件中找不到任何东西.我认为它应该在github上看,因为我知道这里有版本:https://github.com/commonsguy/cwac-camera/releases,所以我怎么能告诉它呢?

另外,例如,当我在我的一个主目录中手动包含jar时,它编译没有错误,但使用import com.commonsware.camera ..(基本上任何东西)导致“无法解决符号commonsware”错误.我认为这意味着我不能手动将它放在某个地方,也许android工作室需要在官方存储库中看到它以允许导入它.它是否正确?

注意:我知道这个库将被重写.如果可能的话我还是想用它.

@R_404_5620@:

so how can I tell it that?

引用the current version of the documentation

To integrate the core AAR, the Gradle recipe is:

repositories {
    maven {
        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
}

dependencies {
    compile 'com.commonsware.cwac:camera:0.6.+'
}

您似乎已添加了依赖项,但未更新您的存储库.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐