parceler icon indicating copy to clipboard operation
parceler copied to clipboard

How to use ParcelClass in multi-module project?

Open bhargavms opened this issue 5 years ago • 2 comments

Lets say I have structure like below in multi module project

JVM external library A {
  class City()
}

Android Module B {
   @ParcelClass(value = City, converter=BlahConverter::class)
   data class Professor(val city: CIty)
}

Android Module C {
   @ParcelClass(value = City, converter=BlahConverter::class)
    data class Professor(val city: CIty)
}

Now when I assemble this, D8 will complain that program type already present for class City$$Parcelable how do i make this work?

bhargavms avatar Dec 16 '19 09:12 bhargavms

Hmm, looks like Module B and C depend on A right? Perhaps define the @ParcelClass in Module A once and just use it from modules B and C?

johncarl81 avatar Dec 16 '19 20:12 johncarl81

that doesnt work because the jvm module A, is an external library , i will update the question pseudocode,

bhargavms avatar Dec 20 '19 03:12 bhargavms