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

Load gif lib error #209

Closed
duguguiyu opened this issue Apr 28, 2015 · 15 comments
Closed

Load gif lib error #209

duguguiyu opened this issue Apr 28, 2015 · 15 comments
Assignees
Labels

Comments

@duguguiyu
Copy link

I build fresco 4.0 like this: compile 'com.facebook.fresco:fresco:0.4.0+'

When I load a gif image into fresco image view, the app crash, the error info like:

E/AndroidRuntime( 5755): java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.wandoujia.ripple-2/lib/arm/libgifimage.so"
E/AndroidRuntime( 5755): at java.lang.Runtime.loadLibrary(Runtime.java:371)
E/AndroidRuntime( 5755): at java.lang.System.loadLibrary(System.java:988)
E/AndroidRuntime( 5755): at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:34)
E/AndroidRuntime( 5755): at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.gif.GifImage.ensure(GifImage.java:40)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.gif.GifImage.create(GifImage.java:62)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.animated.factory.AnimatedImageFactory.decodeGif(AnimatedImageFactory.java:62)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.decoder.ImageDecoder.decodeAnimatedGif(ImageDecoder.java:105)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage(ImageDecoder.java:86)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:231)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:92)
E/AndroidRuntime( 5755): at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$3.run(DecodeProducer.java:202)
E/AndroidRuntime( 5755): at com.facebook.common.executors.SerialDelegatingExecutor.executeSingleCommand(SerialDelegatingExecutor.java:76)
E/AndroidRuntime( 5755): at com.facebook.common.executors.SerialDelegatingExecutor.access$000(SerialDelegatingExecutor.java:24)
E/AndroidRuntime( 5755): at com.facebook.common.executors.SerialDelegatingExecutor$1.run(SerialDelegatingExecutor.java:47)
E/AndroidRuntime( 5755): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime( 5755): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime( 5755): at java.lang.Thread.run(Thread.java:818)

The device is nexus6.

@rockerhieu
Copy link

Happen on Nexus 5 running on Android 5.1 + Fresco 0.2.0, 0.3.0 or 0.4.0 too.

@tyronen tyronen added the bug label Apr 29, 2015
@michalgr
Copy link
Contributor

Does this happen without proguard as well ?

@rockerhieu
Copy link

@michalgr let me try without proguard and update here.

@duguguiyu
Copy link
Author

@michalgr @rockerhieu it works~

@duguguiyu
Copy link
Author

-keep class com.facebook.imagepipeline.gif.** { ; }
-keep class com.facebook.imagepipeline.webp.
* { *; }

@rockerhieu
Copy link

@michalgr it works with proguard disabled. Do you have any suggestion on fixing the proguard rules? In the mean time I will try with different rules and see if I can get rid of the issue.

@rockerhieu
Copy link

@duguguiyu cool, didn't refresh the page 😸

@michalgr
Copy link
Contributor

@duguguiyu your config looks good to me :)
We'll put something about configuring proguard in the docs.

@rockerhieu
Copy link

Here is my final proguard file:

# 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 *;
}
-dontwarn okio.**
-dontwarn javax.annotation.**

-keep class com.facebook.imagepipeline.gif.** { *; }
-keep class com.facebook.imagepipeline.webp.** { *; }

@shangcongrong
Copy link

多谢,帮我解决了问题(不知道打中文能不能看懂,逗逗歪果仁,哈哈~)

@chengfangpeng
Copy link

It seems some developers need to learn Chinese.also, foreigners are not wai nuts . lol

@preetb123
Copy link

SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.imageview);
ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithResourceId(R.raw.sample_gif).build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setUri(imageRequest.getSourceUri())
.setAutoPlayAnimations(true)
.build();
simpleDraweeView.setController(controller);

@gengrui1983
Copy link

Thanks for helping me solve the problem.

@waynell
Copy link

waynell commented Oct 16, 2017

For the latest version, proguard should be:

-keep class com.facebook.animated.webp.** { *; }
-keep class com.facebook.animated.gif.** { *; }

@xiuhaoli
Copy link

You solve my problem, thank you so much

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

No branches or pull requests

10 participants