johncarl81 / parceler

:package: Android Parcelables made easy through code generation.
http://parceler.org
Apache License 2.0
3.56k stars 273 forks source link

How to use ParcelClass in multi-module project? #377

Open bhargavms opened 4 years ago

bhargavms commented 4 years ago

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?

johncarl81 commented 4 years ago

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?

bhargavms commented 4 years ago

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