3

I have a project contains 2 applications and 1 library module. I would like to use RoboGuice because of the view injection feature.

Currently i cannot inject views in my library module, because generated ids in the R.java file are not constants and i get "Attribute values must be constants" error. See explanation here. Since ADT 14, in a library project, ids are not constants because of an optimization feature.

I could decide to use RoboGuice within the 2 application and simply not use in my library module, but I also wondering is there a way to somehow make a workaround to this?

Maybe somehow force A. Studio to generate constant values even in library modules?

Adam Varhegyi
  • 13,647
  • 32
  • 108
  • 194
  • I don't know solution to your exact problem, but for view injection you can check out [Butterknife](http://jakewharton.github.io/butterknife/) – wasyl Oct 03 '15 at 11:42
  • I also have this problem with Butterknife. – Alireza Feb 28 '16 at 14:22

0 Answers0