artem-zinnatullin / RxJavaProGuardRules

ProGuard rules for RxJava shipped as AAR!
Apache License 2.0
719 stars 36 forks source link

Android Shrinker loses field #22

Closed b1uebyte closed 8 years ago

b1uebyte commented 8 years ago

Android shrinker uses proguard rules. But for some reasons shrinker cuts out at least one field (with proguard all fine):

Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: once
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:270)
    at java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:49)
    at rx.schedulers.CachedThreadScheduler$EventLoopWorker.<clinit>(CachedThreadScheduler.java:180)
    at rx.schedulers.CachedThreadScheduler.createWorker(CachedThreadScheduler.java:171) 

So, I can suggest small addition: -keep class rx.schedulers.CachedThreadScheduler$EventLoopWorker { int once; }

artem-zinnatullin commented 8 years ago

Looks like a bug in build tools, if you don't mind — I can report that or you can do it yourself: https://b.android.com

b1uebyte commented 8 years ago

Ok, I'll do it.

b1uebyte commented 8 years ago

So, here it is. But I don't think they are going to implement all proguard features)

artem-zinnatullin commented 8 years ago

Well, Tor already set Priority Medium, so, I guess, they'll fix at least that.

Thanks a lot, Andrey!