android-studio - Android Studio无法解析AutoValue类

标签 android-studio intellij-idea auto-value

我今天开始在我的一个项目中使用AutoValue,令我困扰的是Android Studio无法解析生成的类名(AutoValue_DrawableContent)并将其标记为红色:
enter image description here
我如何抑制此警告?

最佳答案

将“idea”插件添加到您的build.gradle中,例如:

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.ltgt.apt'

使用此插件,Android Studio可以找到生成的源文件。

关于android-studio - Android Studio无法解析AutoValue类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36495172/

相关文章:

android - 无法解析 : com. android

android - 如何在 Android Studio 中编辑使用 Gradle 导入的库的代码?

java - 配置 IntelliJ 以使用 Groovy 编译器而不是 Java 编译器

java - 避免使用代表 JSON 的 POJO 的样板代码

java - AutoValue - 可能的公共(public)构造函数

java - Android 应用程序在启动新 Intent 时崩溃

java - Android Studio - 无法创建 github 存储库

intellij-idea - Intellij 中的代码契约

scala - 在包对象中使用案例类时类型不匹配

Android,编辑Auto Value参数值