Why can't .aidl be included in a library project?

I came across a comment saying that the library project:

  • cannot store .aidl files,
  • cannot depend on another library project,
  • cannot contain assets

Well, this comment was made about a year and a half ago, and I can confidently say that element number 2 is no longer correct ( September 2010 ?), Because I have a perfectly working project made from a library project that depends from another library project.

So my questions are two:

  • Is it true that a library project cannot contain .aidl files?
  • If the answer to # 1 is yes, then what is the reason for this?

BTW, as an experiment, I tried to place IMarketBillingService.aidl (from the In-app Billing example) in the library project (without anything that uses it), and the project builds and works as before. So, if the library project does not contain .aidl , this should be something deeper ...

+6
source share
1 answer

The answer is no. You can use the AIDL file in library projects just fine. I use this setting in three different projects. Do not remember exactly when, but they fixed it a while ago (possibly when they added library support for the ADT library). The reason it didn’t work is because the ADT constructor did not recognize the AIDL file and did not create the necessary Java stubs.

+6
source

Source: https://habr.com/ru/post/905879/


All Articles