Should I add proguard rules for RxJava2?
Thanks for using RxJava but before you post an issue, please consider the following points:
-
[x] Please include the library version number, including the minor and patch version, in the issue text. In addition, if you'd include the major version in the title (such as
2.x) that would be great. -
[ ] If you think you found a bug, please include a code sample that reproduces the problem. Dumping a stacktrace is usually not enough for us.
-
[ ] RxJava has more than 150 operators, we recommend searching the javadoc for keywords of what you try to accomplish.
-
[ ] If you have a question/issue about a library/technology built on top of RxJava (such as Retrofit, RxNetty, etc.), please consider asking a question on StackOverflow first (then maybe on their issue list).
-
[ ] Questions like "how do I X with RxJava" are generally better suited for StackOverflow (where it may already have an answer).
-
[ ] Please avoid cross-posting questions on StackOverflow, this issue list, the Gitter room or the mailing list.
As I know there are many methods and class in RxJava2.
- So I want to know should I add proguard rules for RxJava2 to optimize it.
- If need, can you tell me the proguard rules? (There are only rules for 1.x when I google)
RxJava 2.x doesn't need proguard rules
Why doesn't RxJava2.x need proguard rules?
Because it doesn't use reflection nor causes proguard warnings
Thanks a lot.
If that is true, then why am I getting the following Proguard warnings which cause my build to fail:
Warning: org.reactivestreams.FlowAdapters$FlowToReactiveProcessor: can't find superclass or interface java.util.concurrent.Flow$Processor
Warning: org.reactivestreams.FlowAdapters$FlowToReactiveSubscriber: can't find superclass or interface java.util.concurrent.Flow$Subscriber
Warning: org.reactivestreams.FlowAdapters$FlowToReactiveSubscription: can't find superclass or interface java.util.concurrent.Flow$Subscription
Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow$Publisher
Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow$Processor
Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow$Subscriber
Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow```
Because the people behind reactive streams decided to ship Java 9 classes in a Java 6-compatible artifact
So we need rules for rxjava2?
Upgrade to RxJava 2.2.16 which already contains the rules for ignoring these specific warnings. Depending on your tooling, you may still have to add rules manually: https://github.com/ReactiveX/RxJava#r8-and-proguard-settings