Closed mithilwcities closed 5 years ago
i am aware of that problem, but this library is using quite a lot of java8+ dependent code and i have no plan to change that.
You could try to use Retrolambda or force the compiler to emit java7 bytecode (https://stackoverflow.com/a/22610424) to create a java7 compliant version, but i am not sure how good the result will be.
Getting crash on build() method:
GPlayMusic api = new GPlayMusic.Builder().setAuthToken(authToken).build();
When running on Android Phones with OS versions below Nougat as 'build()' method contains following code:
Optional optional = gPlay.getRegisteredDevices().toList().stream()
and java 8 streams are available from Android Nougat.
Error Log:
Process: com.wcities.eventseeker, PID: 14455 io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | No interface method stream()Ljava/util/stream/Stream; in class Ljava/util/List; or its super classes (declaration of 'java.util.List' appears in /system/framework/core-libart.jar) at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoSuchMethodError: No interface method stream()Ljava/util/stream/Stream; in class Ljava/util/List; or its super classes (declaration of 'java.util.List' appears in /system/framework/core-libart.jar) at com.github.felixgail.gplaymusic.api.GPlayMusic$Builder.build(GPlayMusic.java:389)