android - 找不到....未指定

标签 android maven gradle

我最近写了一个java模块并将其推送到maven,但是当我测试它时,出现了一些错误:

Error:Could not find PreferenceAnnotion:preference-annotation:unspecified.
Searched in the following locations:file:/Applications/Android Studio.app/Contents/gradle/m2repository/PreferenceAnnotion/preference-annotation/unspecified/preference-annotation-unspecified.pom
....
Required by:
    TestPlugin:app:unspecified > com.github.merlinyu:preference-processor:1.0.0

我的模块代码依赖项:
compile project(':preference-annotation')

我不知道如何解决它。

github : https://github.com/MerlinYu/PreferenceAnnotation

最佳答案

当您以这种方式添加 Gradle 依赖项时:

compile project(':preference-annotation')

Gradle 搜索名为 的本地 Gradle 模块偏好注释 .
它不会通过 maven 解决依赖关系。

要包含来自 Maven 存储库的依赖项,您必须使用此元格式(替换为适当的值):
compile 'groupId:artifactId:version(:classifier)(@packaging)'

In your case你必须添加:
compile 'com.github.merlinyu:preference-annotation:1.0.0'

关于android - 找不到....未指定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39483962/

相关文章:

android - EditText 请求焦点不起作用

java - 使用Web预览服务器在eclipse中运行Maven Spring项目

java - SaxLoader 中的 Sphinx4 空指针异常

java - 无法解析类的 super 类型。请确保您具有所需的依赖项

android - 从单独的 Intent 向主 Activity 发送数据

Android 4.0 html 编码在 web View 中崩溃

android - 工具栏不会隐藏在 DrawerLayout 中的滚动回收 View 中

maven - Groovy Maven 编译失败,错误为 : Unable to determine Groovy version. Groovy 是否声明为依赖项?

android - 使用 Android Studio 0.8.9 生成未签名的 APK

java - Android依赖问题