Fresco: java.lang.UnsatisfiedLinkError: com.facebook.imagepipeline.memory.NativeMemoryChunk and java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so

Created on 23 Jul 2019  ·  12Comments  ·  Source: facebook/fresco

Hi, I have two problems, most of them happen on the Android 5.1 system of the OPPO brand mobile phone. The following is the error log.

Log1

java.lang.UnsatisfiedLinkError: com.facebook.imagepipeline.memory.NativeMemoryChunk
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:25)
    at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:13)
    at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:267)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init>(MemoryPooledByteBufferOutputStream.java:51)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.java:106)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newOutputStream(MemoryPooledByteBufferFactory.java:24)
    at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:96)
    at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:73)
    at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$2.onResponse(OkHttpNetworkFetcher.java:193)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)

Log2

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so caused by: dlopen failed: "/data/data/com.saltchucker/lib-main/libimagepipeline.so" is 64-bit instead of 32-bit
    at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
    at com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:40)
    at com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit>(NativeMemoryChunk.java:31)
    at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:25)
    at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:13)
    at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:267)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init>(MemoryPooledByteBufferOutputStream.java:51)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:73)
    at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:24)
    at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:85)
    at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:97)
    at com.facebook.imagepipeline.producers.LocalAssetFetchProducer.getEncodedImage(LocalAssetFetchProducer.java:37)
    at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50)
    at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:46)
    at com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:43)
    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:51)
    at java.lang.Thread.run(Thread.java:818)

Fresco version

implementation "com.facebook.fresco:fresco:1.13.0"
implementation "com.facebook.fresco:animated-gif:1.13.0"
implementation "com.facebook.fresco:animated-webp:1.13.0"
implementation "com.facebook.fresco:webpsupport:1.13.0"
implementation "com.facebook.fresco:imagepipeline-okhttp3:1.13.0"

Most of them happen in the following phones

  • OPPO A59s
  • OPPO A37
  • OPPO A59
  • OPPO R9
stale

Most helpful comment

I have a solution before fresco fix this issue, maybe it can help you.
Preload the libimagepipeline so, shutdown fresco if we catch an UnsatisfiedLinkError, then reinit by disabe native implementation. Like this:

val builder = ImagePipelineConfig.newBuilder(context)
val imagePipelineConfig = builder.build()
Fresco.initialize(context, imagePipelineConfig)
try {
ImagePipelineNativeLoader.load()
} catch (error: UnsatisfiedLinkError) {
Fresco.shutDown()
builder.experiment().setNativeCodeDisabled(true)
imagePipelineConfig = builder.build()
Fresco.initialize(context, imagePipelineConfig)
error.printStackTrace()
}

All 12 comments

Facing the same crash. Please update if there is anyfix.

Any Solution?
I‘m facing the same crash, please resolve it!

I have a solution before fresco fix this issue, maybe it can help you.
Preload the libimagepipeline so, shutdown fresco if we catch an UnsatisfiedLinkError, then reinit by disabe native implementation. Like this:

val builder = ImagePipelineConfig.newBuilder(context)
val imagePipelineConfig = builder.build()
Fresco.initialize(context, imagePipelineConfig)
try {
ImagePipelineNativeLoader.load()
} catch (error: UnsatisfiedLinkError) {
Fresco.shutDown()
builder.experiment().setNativeCodeDisabled(true)
imagePipelineConfig = builder.build()
Fresco.initialize(context, imagePipelineConfig)
error.printStackTrace()
}

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

https://github.com/facebook/SoLoader/pull/45 potentially fixes this issue I suppose.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.

The fix has been landed. We'll release a new Fresco version soon.

@oprisnik

The fix has been landed. We'll release a new Fresco version soon.

Could you provide more information? Any additional changes will be required on configuration side? What is expected version containing fix for mentioned issues?

facebook/SoLoader#45 potentially fixes this issue I suppose.

Has the new version been released?

I use the latest version v2.2, and it still happend in my app.
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so result: 0

Was this page helpful?
0 / 5 - 0 ratings