0

I have a large project consisting of an app and several library projects. The library projects have resources defined, e.g. layouts, string values, that are referenced from the library project like this:

setContentView(R.layout.main);

However after a recent update of ADT this no longer works. Since all resource IDs are "merged" into the app's R.java (no longer reside in the library) the "R" needs to resolve to the app.

I can access the resource by referencing executing package but this seems counter-intuitive as it has always worked as is.

Am I missing something? Is there a setting that specifies to the compiler "use appication level resources instead of library" when resolving these?

UPDATE: this article describes my problem, in my case all resource IDs are getting munged together in 1 common R.java, not separate class files so they may be callable as I describe above.

I am using ADT 21.0.1

Community
  • 1
  • 1
StuTheDog
  • 451
  • 1
  • 11
  • 19

1 Answers1

0

After several cleans and rebuilds I noticed 2 supporting libraries had the same namespace. Although this should be legal I changed one of them, rebuilt and the resources built properly.

StuTheDog
  • 451
  • 1
  • 11
  • 19