Skip to content

3.x: Embed R8 ProGuard rules to ignore Flow* interfaces in RS 1.0.3 #6706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ The base classes can be considered heavy due to the sheer number of static and i

### R8 and ProGuard settings

By default, RxJava doesn't require any ProGuard/R8 settings and should work without problems. Unfortunately, the Reactive Streams dependency since version 1.0.3 has embedded Java 9 class files in its JAR that can cause warnings with ProGuard:
By default, RxJava itself doesn't require any ProGuard/R8 settings and should work without problems. Unfortunately, the Reactive Streams dependency since version 1.0.3 has embedded Java 9 class files in its JAR that can cause warnings with the plain ProGuard:

```
Warning: org.reactivestreams.FlowAdapters$FlowPublisherFromReactive: can't find superclass or interface java.util.concurrent.Flow$Publisher
Expand All @@ -499,15 +499,14 @@ Warning: org.reactivestreams.FlowAdapters$FlowToReactiveSubscription: can't find
Warning: org.reactivestreams.FlowAdapters: can't find referenced class java.util.concurrent.Flow$Publisher
```

It is recommended one sets up one or more of the following `-dontwarn` entries:
It is recommended one sets up the following `-dontwarn` entry in the application's `proguard-ruleset` file:

```
-dontwarn org.reactivestreams.FlowAdapters
-dontwarn org.reactivestreams.**
-dontwarn java.util.concurrent.Flow.**
-dontwarn java.util.concurrent.**
-dontwarn java.util.concurrent.Flow*
```

For R8, the RxJava jar includes the `META-INF/proguard/rxjava3.pro` with the same no-warning clause and should apply automatically.

### Further reading

For further details, consult the [wiki](https://github.com/ReactiveX/RxJava/wiki).
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/proguard/rxjava3.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-dontwarn java.util.concurrent.Flow*