-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add visibility of proguard rules to README or wiki please #3097
Comments
+1 The |
+1 My current proguard settings for RxJava is
|
I'm able to avoid it by keeping everything in |
Yes, this is what I did to patch this issue. |
Full stack trace for NoSuchFieldException, that @julienbanse mentioned.
|
Since it's accessed via reflection, this needs to be kept un-obfuscated.
Thing is, this used to JustWork(tm) because the reflective call was done directly on the target class (e.g. For now, we can either keep everything in package
while waiting for them to be annotated appropriately in the source. |
FWIW for Android at least this is going to be handled by ReactiveX/RxAndroid#219 automatically for consumers. This obviously does not solve if you are ProGuarding for another target (or simply not using RxAndroid on Android). |
@julienbanse + @desseim responses together worked for me. |
@desseim Adding those rules produces these "noted" warnings but it works!:
|
@jaredsburrows You're right, thanks for noticing.
On my code base (and yours too apparently), |
@desseim @felipesci Thank you so much for posting this. I have recently updated
and those current proguard rules do not seem to work anymore. |
@jaredsburrows I've backed ProGuard rules for RxJava as // if you'll face a problem — feel free to create an issue in the repository of the rules and I'll make a fix and ship new version. |
@artem-zinnatullin Sure! I believe I am using the same rules as your dependency is providing. You have tested this against |
@jaredsburrows yep, we use it with |
@artem-zinnatullin I am using this with Retrofit and I see the logs with proguard on but I am not seeing the UI get updated. I am still investigating and I will try to keep you updated. |
@artem-zinnatullin Just a quick update. The issue I was seeing was related to another issue with a few proguard rules and not related to the rules you have provided. Your rules work very well. Thanks for your support. |
Ok, thanks for update 👍 |
I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one. |
We're using RxJava 1.1.5 in production currently for Android with ProGuard, and according to crash logs this issue pops up time to time on certain device + os conditions. To be specific the conditions seem to be (out of literally millions of sessions):
-keep class rx.* { ; } The crash rate is really low, but it's certainly happening. Has anyone encountered with this? There seem to be some funky vendor-specific thing going on there. So far we couldn't test this in house with the problematic devices. Edit: |
See #3459 |
With those rules there's no point in using ProGuard. You're keeping the On Sun, Jun 12, 2016, 5:04 AM Artem Zinnatullin notifications@github.com
|
Just to clear this up, again, please see @desseim's post here: #3097 (comment). |
Probably they want to shrink all other libraries and keep RxJava to avoid On Sun, 12 Jun 2016, 18:05 Jake Wharton, notifications@github.com wrote:
|
Well yes, this ProGuard config doesn't do a thing with RxJava, we mostly use to to shrink down other stuff. This might not be the most optimal thing to do, but the point here is that we're keeping everything from Rx and the issue still happens. I might miss something, but the way I see it, the links you provided discuss how ProGuard might screw things up with a config that enables it to shrink RxJava. My hunch is still that this is due to some funky Samsung-specific thing on their Android versions I mentioned. As a short-term workaround, I'll use the 'rx.unsafe-disable' to disable Unsafe. |
You can disable Unsafe only on Samsung devices btw. On Mon, 13 Jun 2016, 11:00 Zsombor Erdődy-Nagy, notifications@github.com
|
@rzsombor, we encountered a very similar issue with a different library (greenDAO), maybe it could shed some light on the issue you encountered here. We get: Only happens on Samsung 5.0/5.0.1/5.0.2 devices in the wild, we can't reproduce this issue in-house. We have the recommended greenDAO proguard configuration. Decompiling our APK shows that the "problematic" class does indeed have a public TABLENAME field: So we can only join your conclusion that it's a weird Samsung bug. Unfortunately, we don't even have a work-around... Kinda hoping the guys in this project can come up with something... Btw, other people encountered the same issue with greenDAO (note that the suggested solutions such as adding proguard rules or upgrading to the latest version do not solve the issue): |
@artem-zinnatullin Oh yes, forgot to add that - only switching Unsafe off on these problematic device - OS combinations. @eranpolo Thanks the extra info. I'm still trying to get my hands on an affected device to get to the bottom of this. Edit: for reference, our current naive workaround for the Samsung-issue:
|
@rzsombor a list of devices that it happened to here are:
all of those devices had this crash after adding the proguard rules from greenrobot/greenDAO#188 |
Are there examples of proguard rules that will work with minifyEnabled set to true? I'm currently getting:
The text was updated successfully, but these errors were encountered: