Skip to content

2.x: Possible 6.x/Android compatibility issue #4653

Closed
@ZacSweers

Description

@ZacSweers

If I have an Android app targeting source compatibility 1.8, I get the following exception at runtime on a 7.0 device:

FATAL EXCEPTION: RxSchedulerPurge-1
     Process: io.sweers.catchup.debug, PID: 29250
     java.lang.NoSuchMethodError: No virtual method keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView; in class Ljava/util/concurrent/ConcurrentHashMap; or its super classes (declaration of 'java.util.concurrent.ConcurrentHashMap' appears in /system/framework/core-libart.jar)
         at io.reactivex.internal.schedulers.SchedulerPoolFactory$1.run(SchedulerPoolFactory.java:69)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:278)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:273)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
         at java.lang.Thread.run(Thread.java:761)

The exact line is:

for (ScheduledThreadPoolExecutor e : new ArrayList<ScheduledThreadPoolExecutor>(POOLS.keySet())) {  // CHM.keySet returns KeySetView in Java 8+; false positive here

When I look at it in the debugger, it is indeed a KeySetView, but I'm not sure what the issue is here. Let me know if this would be better served posting in RxAndroid.

CC @JakeWharton

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions