Status Update
Comments
jb...@google.com <jb...@google.com> #2
Also crashes in R8 version 8.5.35, 8.6.17, 8.7.2-dev
si...@sentbe.com <si...@sentbe.com> #3
You cannot apply keep rules for classes synthesized by R8, but if you keep the implemented interfaces, the merging should not happen.
That said, checking the implementing class of a lambda might not be a good idea. The specification for java.lang.invoke.LambdaMetafactory
Capture may involve allocation of a new function object, or may return a suitable existing function object. The identity of a function object produced by capture is unpredictable, and therefore identity-sensitive operations (such as reference equality, object locking, and System.identityHashCode()) may produce different results in different implementations, or even upon different invocations in the same implementation.
If I understand this correctly the only guarantee is that the function object implements the interface(s) specified.
jb...@google.com <jb...@google.com> #4
The actual problem is that R8 deletes FunInterface1 and FunInterface2 classes, which are used for runtime di:
fun hello() {
val instance1 = FunInterface1 { println("Doing business") }
val instance2 = FunInterface2 { println("Starting the show") }
val map = mapOf(
FunInterface1::class.java to instance1,
FunInterface2::class.java to instance2,
)
check(map.size == 2) { "Map size is ${map.size}" }
}
So do I have to list all fun interfaces in my sdk using -keep? I might do that for ~100 of them that exist right now, but this won't save future developers from adding another fun interface and forgetting to list them in .pro file.
Description
Component used: Navigation
Version used: 2.5.3
Devices/Android versions reproduced on: Pixel 3a API 33
If this is a bug in the library, we would appreciate if you could attach:
Sample project to trigger the issue. A screenrecord or screenshots showing the issue (if UI related). I used jetpack compose navigation for nested graph. here my project structure. If this is a bug in the library, we would appreciate if you could attach:
I used jetpack compose navigation for nested graph. here my project structure.
// top level navHost
new screen with bottom navigation bar
A,B,C Screen in tempGraph
Presumably error source !!
!!! The funny thing is that it works just fine for normal types. (only custom type) !!!
Exception Log