我最近写了一个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/