AIDL interface can't find import for Parcelable class

后端 未结 1 1384
梦谈多话
梦谈多话 2020-12-18 17:28

My issue seems to be similar to this question and this one but it is a bit different.

I am making an AIDL service that is in a Library project and using it in my app

相关标签:
1条回答
  • 2020-12-18 17:39

    I'm reasonably certain you need to have the Parcelable classes in the same package on both ends (which is what you end up with by using the one from APPLICATION on the library side, I would just do it the other way around). This package has to also be the one declared in the corresponding aidl file.

    I'd suggest to use a subpackage like com.example.interop to make this cleaner (i.e., separate the shared objects in their own package). Both sides should then have a Java file in that package + an aidl file that declares it.

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