Status Update
Comments
xa...@google.com <xa...@google.com>
je...@google.com <je...@google.com>
am...@google.com <am...@google.com>
am...@google.com <am...@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).
vi...@gmail.com <vi...@gmail.com> #3
(I have a pending CL that was working to improve the handling of fields now that r8 handles desugaring fields, I'll try to dust that off and combine the fix in there.)
Description
Android requires us to specify these tags for foreground services:https://developer.android.com/about/versions/14/changes/fgs-types-required
If we use WorkManager, as suggested, then we have to specify what FGS type we are using:https://developer.android.com/develop/background-work/background-tasks/persistent/how-to/long-running#declare-foreground-service-types-manifest
If we use different FGS types in our application, either from different libraries we control, or from SDKs that we do not, then we want the final declaration to be merged.
Currently this isn't possible as if we have 2 defined
foregroundServiceType
for 1 service (say the work manager service), we get the following error:(project attached)
We would have to use
tools:replace
at the application level, and that does work, but then if the upstream projects or SDKs change, add, or remove aforegroundServiceType
, that will silently fail as we have no way of knowing it didn't merge.