Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio can not resolve AutoValue class

I started to use AutoValue today in one of my projects and what bothers me is that Android Studio can not resolve the generated class name (AutoValue_DrawableContent) and marks it with the red color:

enter image description here

How I can suppress this warning?

like image 872
aga Avatar asked Apr 08 '16 08:04

aga


2 Answers

you can just comment out each dependencies and sync one by one... it might get things fixed...

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
like image 160
Wasi Sadman Avatar answered Oct 04 '22 01:10

Wasi Sadman


Add the "idea" plugin to your build.gradle, for example:

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

With this plugin, Android Studio can find the generated source files.

like image 44
gladed Avatar answered Oct 04 '22 01:10

gladed