facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.07k stars 3.75k forks source link

Fatal Exception: java.lang.UnsatisfiedLinkError #2322

Open Cutta opened 5 years ago

Cutta commented 5 years ago

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

erikandre commented 5 years ago

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?

defHLT commented 5 years ago

@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.

erikandre commented 5 years ago

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

hardapps1692 commented 5 years ago

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 commented 5 years ago

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

kirin233x commented 3 years ago

Any progress?I have met the same problem.

JimmieQian commented 2 years ago

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.