fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Fatal Exception: java.lang.UnsatisfiedLinkError

Open Cutta opened this issue 7 years ago • 7 comments

Description

I've seen similar issues, but the solutions didn't work. https://github.com/facebook/fresco/issues/2049

There are lots of "UnsatisfiedLinkError" issues but I think my problem is not SoLoader or Relinker problem.

My stacktrace:


Fatal Exception: 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.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.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.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)

Reproduction

No reproduction steps. Because it happens on rare devices. (LENOVO, HTC, OPPO, MEIZU)

Additional Information

  • Fresco version: 1.13.0
  • Platform version: LENOVO, HTC, OPPO, MEIZU & Lollipop and Marshmallow And I migrated androidx so my targetSdk is 28.

Cutta avatar Apr 16 '19 07:04 Cutta

Hi @Cutta

Thank you for reporting this.

@oprisnik & @defHLT - Since this seems to pop up again and again, could we add some logging to BasePool.get to figure out why linking failed?

erikandre avatar Apr 16 '19 08:04 erikandre

@erikandre I'm not sure what kind of logging would help. BasePool#get is just an entry point that delegates to NativeMemoryChunkPool#alloc. The problem happens when SoLoader.loadLibrary("imagepipeline") is executed.

defHLT avatar Apr 16 '19 10:04 defHLT

Maybe we should make the SoLoader.loadLibrary("imagepipeline") call a fatal error if it fails then? So that the true error cause would be logged instead of just the fact we cannot invoke the missing code

erikandre avatar Apr 16 '19 10:04 erikandre

what is the solution to this bug? We are just posting bug and issue but it not resolved for 6 months. Why not changing in code? Such big trouble for developers.

hardapps1692 avatar Jun 14 '19 14:06 hardapps1692

Any solution for this bug? Please update for the issue.

hardapps1692 avatar Jun 29 '19 14:06 hardapps1692

Any progress?I have met the same problem.

kirin233x avatar Jan 11 '21 13:01 kirin233x

I have the same problem too. Fresco version: 2.0.0

Fatal Exception: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.imagepipeline.memory.NativeMemoryChunk; see exception in other thread
       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:266)
       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:203)
       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:764)

My device is Avaya Vantage, OS version Android 9.

JimmieQian avatar Jan 12 '22 02:01 JimmieQian