fragmentviewbindingdelegate-kt
fragmentviewbindingdelegate-kt copied to clipboard
Not working in a library project
Thank you for the clean approach and the library!
However, if I incorporate it into another library project that is published or consumed as an AAR library, then the code will crash. Please see https://stackoverflow.com/questions/59067743/what-is-this-error-and-why-this-doesnt-happen-when-i-dont-use-library-like-a-c
So please implement all DefaultLifecycleObserver lifecycle methods with empty bodies in both places in the delegate.
Hey!
Isn't the issue merely that the library that is trying to use this is not using:
compileOptions {
this.sourceCompatibility(JavaVersion.VERSION_1_8)
this.targetCompatibility(JavaVersion.VERSION_1_8)
}
kotlinOptions {
jvmTarget = "1.8"
}
?
Then again, I always figured default methods in desugaring could be shady, so if that doesn't work, I'll add the empty method bodies.
Hi! Thank you for the comment! Hmm - now thinking of it, it very well could be the issue you mention; I did check that the main project had those options enabled, but I am not sure if the library project had :( So could explain it. It was such a weird issue that I didn't think of this solution.
I ran into the same issue with an android library module using this library ... :(
You have enabled viewBinding and added
compileOptions {
sourceCompatibility(JavaVersion.VERSION_1_8)
targetCompatibility(JavaVersion.VERSION_1_8)
}
kotlinOptions {
jvmTarget = "1.8"
}
right?
yes I did... :/