Skip to content
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

Fresco crashes when proguard is true #1115

Closed
ghost opened this issue Apr 10, 2016 · 2 comments
Closed

Fresco crashes when proguard is true #1115

ghost opened this issue Apr 10, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 10, 2016

this error occurs only when proguard "minifyEnabled true"

please note that i excluded Facebook from proguard rules

Facebook

-keep class com.facebook.**
-keep interface com.facebook.**
-keep enum com.facebook.**

Fresco

-keep class com.facebook.fresco.**
-keep interface com.facebook.fresco.**
-keep enum com.facebook.fresco.**

AndroidRuntime: FATAL EXCEPTION: Thread-6712 Process: com.whatshudoin.android, PID: 30386 java.lang.NoSuchMethodError: no static or non-static method "Lcom/facebook/imagepipeline/nativecode/Bitmaps;.nativeCopyBitmap(Landroid/graphics/Bitmap;ILandroid/graphics/Bitmap;II)V" at java.lang.Runtime.nativeLoad(Native Method) at java.lang.Runtime.doLoad(Runtime.java:435) at java.lang.Runtime.loadLibrary(Runtime.java:363) at java.lang.System.loadLibrary(System.java:526) at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.a(SoLoaderShim.java:32) at com.facebook.common.soloader.SoLoaderShim.a(SoLoaderShim.java:56) at com.facebook.imagepipeline.nativecode.Bitmaps.<clinit>(Bitmaps.java:27) at com.facebook.imagepipeline.platform.DalvikPurgeableDecoder.a(DalvikPurgeableDecoder.java:155) at com.facebook.imagepipeline.platform.KitKatPurgeableDecoder.a(KitKatPurgeableDecoder.java:32) at com.facebook.imagepipeline.platform.DalvikPurgeableDecoder.a(DalvikPurgeableDecoder.java:61) at com.facebook.imagepipeline.platform.KitKatPurgeableDecoder.a(KitKatPurgeableDecoder.java:32) at com.facebook.imagepipeline.decoder.ImageDecoder.a(ImageDecoder.java:127) at com.facebook.imagepipeline.decoder.ImageDecoder.a(ImageDecoder.java:94) at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.c(DecodeProducer.java:189) at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.a(DecodeProducer.java:97) at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.a(DecodeProducer.java:129) at com.facebook.imagepipeline.producers.JobScheduler.e(JobScheduler.java:207) at com.facebook.imagepipeline.producers.JobScheduler.a(JobScheduler.java:27) at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43) at java.lang.Thread.run(Thread.java:841)

@kenilt
Copy link

kenilt commented Apr 11, 2016

I think you should change your proguard rule like this.
http://frescolib.org/docs/proguard.html

And rule bellow is this proguard rule:

# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.common.internal.DoNotStrip *;
}

# Keep native methods
-keepclassmembers class * {
    native <methods>;
}

-dontwarn okio.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**

@ghost
Copy link
Author

ghost commented Apr 11, 2016

@kenilt thanks a lot it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants