R.java file from Android library project not importing into application project

后端 未结 2 425
借酒劲吻你
借酒劲吻你 2020-12-31 23:54

I followed the instructions here on how to create an Android library project, and use it in an Android application:

http://developer.android.com/guide/developing/ecl

相关标签:
2条回答
  • 2021-01-01 00:39

    The answer to my conundrum was that the library had an attrs.xml file that defined a few custom attributes for a custom view I created. I removed attrs.xml and hardcoded the values in the custom view code, rebuilt the library, and problem solved.

    This isn't cool though, what this means is that custom views with custom attributes can't be used in libraries. I hope Google fixes this.

    0 讨论(0)
  • 2021-01-01 00:40

    It's actually a matter of file duplicity. You can't build a project that contains more than one instance of the same file. Due to the nature of an android project XML files are usually the first the negate a successful build.

    0 讨论(0)
提交回复
热议问题