01-19 10:47:56.855: E/AndroidRuntime(30977): java.lang.ExceptionInInitializerError
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.doTransform(ResizeAndRotateProducer.java:154)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.access$000(ResizeAndRotateProducer.java:72)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer$1.run(ResizeAndRotateProducer.java:89)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
01-19 10:47:56.855: E/AndroidRuntime(30977): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-19 10:47:56.855: E/AndroidRuntime(30977): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
01-19 10:47:56.855: E/AndroidRuntime(30977): at java.lang.Thread.run(Thread.java:856)
01-19 10:47:56.855: E/AndroidRuntime(30977): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1946 could not load needed library 'libwebp.so' for 'libimagepipeline.so' (load_library[1094]: Library 'libwebp.so' not found)
01-19 10:47:56.855: E/AndroidRuntime(30977): at java.lang.Runtime.loadLibrary(Runtime.java:370)
01-19 10:47:56.855: E/AndroidRuntime(30977): at java.lang.System.loadLibrary(System.java:535)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:32)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:43)
01-19 10:47:56.855: E/AndroidRuntime(30977): at com.facebook.imagepipeline.nativecode.JpegTranscoder.
01-19 10:47:56.855: E/AndroidRuntime(30977): ... 10 more
device : samsung note2;dev tool: eclipse; android4.1.2
Thx for reporting it, @massimocarli will have a look
This will probably happen because you're using webp images and 0.9.0 made them optional. You shouldn't see an exception but adding the dependency to webp would probably solve your issue:
http://frescolib.org/docs/webp-support.html#_
@balazsbalazs Can't solve in eclipse
@wangmeng1989 We've just added the jars for eclipse here https://github.com/facebook/fresco/releases/tag/v0.9.0 . Please try to add the static-webp dependency and see if the problem has been fixed. Thanks
@massimocarli Thank you for your answer
@massimocarli Very sorry, the problem still exists in low version of the mobile phone (my phone is android 4.1.2)
log:
01-25 14:49:53.440: E/AndroidRuntime(6543): java.lang.NoClassDefFoundError: com/facebook/imagepipeline/nativecode/JpegTranscoder
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.doTransform(ResizeAndRotateProducer.java:154)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.access$000(ResizeAndRotateProducer.java:72)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer$1.run(ResizeAndRotateProducer.java:89)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
01-25 14:49:53.440: E/AndroidRuntime(6543): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
01-25 14:49:53.440: E/AndroidRuntime(6543): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
01-25 14:49:53.440: E/AndroidRuntime(6543): at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
01-25 14:49:53.440: E/AndroidRuntime(6543): at java.lang.Thread.run(Thread.java:856)
fresco dependency :
drawee,fbcore,imageplpeline-base,imagepipeline,static-webp
@wangmeng1989 Can you please provide us more information in order to reproduce it? You mentioned you used the Android version 4.1.2. What does your code do? What format of image you're downloading? Are you fetching from the network? In case, can you provide us the URL of the image you're trying to download? Are you resizing the image? You mentioned you're using eclipse, right?
Thanks
@massimocarli Yes, I use of development tools is the eclipse.
I have same question
I have same question
We're trying to reproduce the problem. In the meanwhile, as a temporal fix, could you try to put this into your main Activity or Application and see if it fixes?
static {
try {
SoLoaderShim.loadLibrary("webp");
} catch(UnsatisfiedLinkError nle) {
}
}
Thanks
Thanks, @massimocarli . It really worked. But this question only occurs on one mobile(MEIZU MX 4.1.2). Will this static statement affect orther mobiles?.
The same problem was happening for me with my Samsung Galaxy S2. It's running 4.1.2. I'm also using ResizeOptions. Here's a typical sample of my code:
Uri uri = Uri.parse( source.getUrl() );
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
.setResizeOptions( new ResizeOptions(imageWidth, imageHeight) )
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setOldController( itemHolder.image.getController() )
.setImageRequest( request )
.build();
itemHolder.image.setController(controller);
Adding the static reference inside my Application class resolved the error
OK, so the problems seems to be present only for Android 4.1.2 right? We'll make some test with this version and with ResizeOptions.
Is this present only on eclipse or also in Android Studio? Cannot replicate on AS
I am getting this issue on different Android versions
Anyway I'll try the proposed fixes and see if it solves the problem
I'm getting error from SoLoaderShim
Fatal Exception: java.lang.UnsatisfiedLinkError: Couldn't load memchunk from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/myapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:355)
at java.lang.System.loadLibrary(System.java:525)
at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:32)
at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:60)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.free(NativeMemoryChunkPool.java:22)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:259)
at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java)
at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java)
at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newOutputStream(NativePooledByteBufferFactory.java:131)
at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newOutputStream(NativePooledByteBufferFactory.java:26)
at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:96)
at com.facebook.imagepipeline.producers.NetworkFetchProducer.access$000(NetworkFetchProducer.java:37)
at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:72)
at com.facebook.imagepipeline.backends.okhttp.OkHttpNetworkFetcher$2.onResponse(OkHttpNetworkFetcher.java:116)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
A possible solution would be using Relinker library in SoLoaderShim with Relinker.findLibrary() instead of System.findLibrary()
EDIT: Actually, the app can override the default working of SoLoaderShim with a Handler implementation.
SoLoaderShim.setHandler(new SoLoaderShim.Handler() {
@Override
public void loadLibrary(String libraryName) {
ReLinker.loadLibrary(CustomApplication.this, libraryName);
}
});
Hi @Zhuinden,
is the ReLinker solving this issue?
Thanks
@massimocarli I do not have the phone on me, but the crash that I got
[DexPathList[[zip file "/data/app/myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/myapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null
is exactly the same crash as what was fixed in Realm v0.88.0-SNAPSHOT by adding Relinker.
I do not know if it specifically solves the webp problem, though. This app is still stuck on 0.7.0, and the webp things started happening only in 0.9.0.
Thanks @Zhuinden, we've recently open-sourced SoLoader so replacing SoLoaderShim with it should fix the problem. Until we don't make a new release using a default Handler for it should fix.
Thanks
merge into #410
@Zhuinden Do you guys know if this was fixed in 0.10.0 ? Do we still need to load the libs through ReLinker ?
@ffelini I'm actually not sure, I haven't updated Fresco in a while. It depends on whether Fresco has integrated Facebook's SoLoader yet, which is now also opensource
Most helpful comment
We're trying to reproduce the problem. In the meanwhile, as a temporal fix, could you try to put this into your main Activity or Application and see if it fixes?
Thanks