Issue
I am trying to set a icon variable so that I can use it within my library fragment.
The icons ive put in the drawable folders...
When I try the following it does not work?
private final static int ICON_FOLDER = R.drawable.ic_folder;
Says cannot resolve R? I even tried to import the library R however this was not possible? Ive tried clean and rebuild (which usually fixes it) and no luck.
It is strange as to why it is not working ive never had this issue and the internet doesnt seem to have an answer as to what im doing, which is to use the resource of the library within the library itself.
UPDATE 1.0____________________________________
Strangely my application (which is using the library currently) is showing error on R as well... i just did another rebuild & clean no luck though!
UPDATE 2.0 ___________________________________
All my R is now displaying errors? maybe this is a SDK issue?
UPDATE 3.0 ___________________________________
So the reason my main app was not working was that it was missing the build folder with the generated r etc, i just copied it from a backup and now that works
UPDATE 4.0 ___________________________________
**Still cannot use R within the library, may this be caused by r being in my main app and a library cannot depend on a normal project? would this be the case? I am not too sure? Because I can reference my icon within the app but not within the library.
UPDATE 5.0 __________________________________
There is an issue with my library, as in the library android documentation "source code in the library module can access its own resources through its R class."
Solution
Finally figured it out! Both the Build folders of my application as well as the library must have been corrupt or missing as replacing it with backups of this folder fixed all the problems, I am guessing r - the generated file must have been defected.
Answered By - Kurdish Droid
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.