5

I have a weird situation here. My application is using annotation in android. I had to use few of the methods which requires annotated class directly. But when ever I am cleaning my project or starting my eclipse imports is giving me error.

 import com.black.devil.app.view.CustomDetailsItemView_ cannot be resolved

Have anybody faced this problem before or any clue how to resolve it. Currently, after cleaning my project or starting eclipse, I remove all my imports and then again re import help me resolve my error. But I need to do this every time I clean/ start eclipse. Any permanent solution for this. I don't what code to post so tell if I need to post any thing else.

thanks Black Devil.

Android
  • 3,828
  • 9
  • 46
  • 79

3 Answers3

5

This is actually a well-known issue on Eclipse. We have a section in the wiki for this.

You can fix it by (here is an example for Pref but it should work for every generated clases :

  • Importing the whole package: import com.company.*;
  • Using a fully qualified name : @SharedPref com.company.MyPref_ myPref;
  • Having MyBean and MyPref_ in the same package.
DayS
  • 1,561
  • 11
  • 15
  • Hey thnx DayS. That worked. But is still there no solution for this apart from import? (as this only can be possibly easiest solution in my case) :D – Android Sep 19 '13 at 06:30
  • The easiest way is to never reference generate classes in your code. However you'll still have this kind of problem for `@SharedPref` because we're forced to use generated class in the code – DayS Sep 19 '13 at 07:20
0

are you sure that the path to your library was correct? check it in Project->Properties->Java Build Path

Lebedevsd
  • 950
  • 5
  • 12
  • Yup every thing working fine wrt to build path and project working. Problem seems to arise when I clean or restart/start eclipse. – Android Sep 19 '13 at 05:43
0

try to mark generated-sources/annotations folder as "Root sources". This works in intellij idea.