Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidAnnotations cannot find symbol class

I'm using AndroidAnnotations in an Android Studio gradle project. I currently get error output from AA during compilation that says:

cannot find symbol class MyActivity_

The error output does not prevent building the application - its not really a compile error because the class is there, it seems that it is just an unfortunate timing issue with the compilation process.

Is there anything I can do to avoid these false-positive errors from AA? When there are "fake" errors shown every time I compile, its very easy to miss the real errors.

like image 280
SuperDeclarative Avatar asked Oct 23 '14 18:10

SuperDeclarative


2 Answers

I had same error. To solve it I have revert my last changes and it has worked again. I think it was either wrong optimized import(you must import generated classes eg. xxx_) or I injected layout by id what was not existed in the layout xml

Update

I figured it. My problem was what I had use private mofidier instead of proteced in

@ViewById(R.id.list) 
private ListView list;
like image 57
Evgeny Avatar answered Nov 04 '22 00:11

Evgeny


Try to see if you missed to fix some errors in the class MainActivity or in someone of his Bean member that you have annoted.

like image 1
Qu4sar Avatar answered Nov 03 '22 23:11

Qu4sar