hi; I have the following issue: library A; 1.0.4...
# announcements
v
hi; I have the following issue: library A; 1.0.4
Copy code
data class Test(
  val a: String,
  val b: String? = null
)
library A; 1.0.5
Copy code
data class Test(
  val a: String,
  val b: String? = null,
  val c: String? = null
)
library B; 1.0.1 -> library A; [1.0, 2.0) // when built -> 1.0.4 library C; -> library B; [1.0, 2.0) -> library A; [1.0, 2.0) now, when building library C again; -> library B; [1.0, 2.0) -> 1.0.1 -> library A; [1.0, 2.0) -> 1.0.5 here; given library A; 1.0.5 gets picked; the library C, when running, gives me
java.lang.NoSuchMethodError: Test.<init>
when it should've ideally not (I think?) can someone help me figure out why this is happening, and how I can mitigate this?
n
sounds like a Gradle question
v
maven actually; but I guess this is regarding default ctor and synthetic methods
(idk what synthetic methods are; just a couple of stackoverflow methods which tell me so)
adding default params is an ABI break
1
@JvmOverloads
would help with the constructor, but
copy()
will still be broken
there's no way around it except not using a data class
t
remove library dep from library C, maven and gradle should handle transitive dependency themselves. or force library C to stay at 1.0.4 until library B upgrades. not ideal, but as others have said, nothing else you can do, it is a problem in library C release a breaking change as patch version (you might want to contact library C maintainers and have them fix, though that would break version 1.0.5, so I don’t really see a way out)