Fixed
Status Update
Comments
je...@google.com <je...@google.com>
je...@google.com <je...@google.com>
an...@google.com <an...@google.com> #2
I can reproduce this (thanks for the repro project!)
It looks like the problem is that the desugared api list from r8 contains this entry:
java/util/Collection#removeIf(Ljava/util/function/Predicate;)Z
but the bytecode here doesn't match -- it's java/util/ArrayList. Collection isn't a directly implemented interface or a direct super class, it's an interface on the super super class. The most efficient thing runtime wise would be for the signature list to inline this method on all implemented subclasses. But I should probably at least for now go and make the desugared API lookup do something similar to what it does for API lookup -- search through all super classes and interfaces as well. This isn't a new problem, so I'm very surprised this hasn't come up before (or it has, and I've forgotten).
Description
I am attempting to get Robolectric unit tests for my Android Library that uses a JNI
.so
working. I can manually get the tests to run and use the.so
by building the JNI library for my native system and adding the path to the.so
toandroid.testOptions.unitTests.all{systemProperty("java.library.path"...)
Specifically I am trying to get the JNI building and hooked up properly for unit tests on my Android library and my test apps. My cross-compiling tasks that build the JNI libraries for Android are working properly when I add them to (Link to source) .
variant.jniLibs.addGeneratedSourceDirectory()
I tried to do something similar with my new tasks for natively building the JNI .so files using
variant.unitTest.jniLibs.addGeneratedSourceDirectory()
but I'm not seeing any effect and there's no task dependencies being triggered.Additional information: My JNI library is written in Rust and I was never able to get it to work well with existing AGP DSLs like
externalNativeBuild
orndk
(perhaps partially because I build it as part of an Android library and not an app? The full source that builds the JNI libraries is in the directory that I linked to above.