android - 来自模块的注释依赖不起作用

标签 android gradle module dependencies cannot-find-symbol

构建.gradle

configurations.all {
resolutionStrategy {
    force 'com.android.support:support-annotations:23.1.1'
}}

异步任务
import android.annotation.MainThread; import android.annotation.Nullable; import android.annotation.WorkerThread;
知道为什么上述导入无法解决吗?

最佳答案

免责声明 : 我对Android开发一无所知。

在 Gradle 中,依赖关系在 dependencies 中定义。像这样的配置 block :

dependencies {
    implementation 'com.android.support:support-annotations:23.1.1'
} 

dependencies userguide 中阅读 mir .
resolutionStrategy相反,用于控制在发生版本冲突的情况下使用特定依赖项的哪个版本(传递依赖项)以及其他 use cases .

关于android - 来自模块的注释依赖不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59342111/

相关文章:

windows - Windows 事件日志中的应用程序错误,错误模块名称未知,为什么?

unit-testing - 如何使用 Gradle 在 grails-core 项目中运行单个测试?

haskell - GHCi 没有看到我的模块

Javascript 模块 : return a bare object, 或命名

android - 如果应用持有部分唤醒锁并且手机被唤醒,其他进程是否也可以访问 CPU?

deployment - Gradle + Jenkins:发布到其他用户的目录

java - SpringBoot Bean类型找不到

android - setVisibility(View.GONE) 不会消失 View

安卓 : click/touch event not working after canvas translate

java - ListView 中的按钮每个项目布局