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

Fatal Exception: java.lang.UnsatisfiedLinkError couldn't find DSO to load: libimagepipeline.so / com.facebook.imagepipeline.memory.NativeMemoryChunk #2049

Open
hsandyque opened this issue Feb 11, 2018 · 88 comments

Comments

@hsandyque
Copy link

hsandyque commented Feb 11, 2018

Description

Update to version 1.8.0, Crashlytic report these issues.
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:522) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:420) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:370) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:335) at com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:42) at com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit>(NativeMemoryChunk.java:33) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257) at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.<init>(NativePooledByteBufferOutputStream.java:51) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:98) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:26) at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:89) at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:101) at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.java:39) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:54) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50) at com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:45) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1115) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:590) at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:53) at java.lang.Thread.run(Thread.java:818)

Fatal Exception: java.lang.UnsatisfiedLinkError: com.facebook.imagepipeline.memory.NativeMemoryChunk at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257) at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.<init>(NativePooledByteBufferOutputStream.java:51) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:98) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:26) at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:89) at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:101) at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.java:39) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:54) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50) at com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:45) 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:53) at java.lang.Thread.run(Thread.java:818)

Reproduction

Solution

I want to know if update to 1.8.1 can fix these issues or I need add compile 'com.facebook.soloader:soloader:0.1.0+' to build.gradle

Additional Information

  • Fresco version:
    compile 'com.facebook.fresco:fresco:1.8.0'
    compile 'com.facebook.fresco:animated-gif:1.8.10'
  • Platform version:
    OPPO - OS: Android 5.1.1
    DEVICE: R7sfg / R7g / A51fa
@oprisnik
Copy link
Contributor

How is your build set up? Are you using ABI splits? http://frescolib.org/docs/shipping.html

@oprisnik oprisnik added the needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem) label Feb 13, 2018
@hsandyque
Copy link
Author

hsandyque commented Feb 13, 2018

@oprisnik
my build setup
android { compileSdkVersion 27 buildToolsVersion '27.0.3' defaultConfig { applicationId "com.mobix.pinecone" minSdkVersion 15 targetSdkVersion 27 versionCode 83 versionName '5.42' multiDexEnabled true } buildTypes { release { minifyEnabled false multiDexKeepProguard file("proguard.multidex.config") } debug { minifyEnabled false multiDexKeepProguard file("proguard.multidex.config") } } productFlavors { } dexOptions { jumboMode true javaMaxHeapSize "4g" } testOptions { unitTests.returnDefaultValues = true } }

and multidex config
-keepclassmembers class * implements android.os.Parcelable { static ** CREATOR; } -dontwarn com.google.android.gms.** -keep class com.google.android.gms.** { *; } -keep class com.google.firebase.** { *; } -keep class io.realm.** { *; } -keep class io.branch.** { *; } -keep class io.fabric.sdk.android.** { *; } -keep class io.socket.** { *; } -keep class com.google.android.youtube.** { *; } -keep class com.crashlytics.android.** { *; } -keep class com.facebook.internal.FacebookInitProvider.** { *; } -keep class com.facebook.FacebookSdk.** { *; } -keep class com.facebook.appevents.AppEventsLogger.** { *; } -keep class com.facebook.common.memory.MemoryTrimmableRegistry.** { *; } -keep class com.facebook.drawee.backends.pipeline.Fresco.** { *; } -keep class com.facebook.imagepipeline.core.ImagePipelineConfig.** { *; } -keep class me.zhanghai.android.materialprogressbar.** { *; } -keep class com.nguyenhoanglam.imagepicker.** { *;} -keep class com.iarcuschin.simpleratingbar.** { *;} -keep class android.support.v4.app.NotificationManagerCompat.** { *;}

@hsandyque
Copy link
Author

hsandyque commented Feb 13, 2018

I don't know why it only happen on OPPO - OS: Android 5.1.1 and before update to version 1.8.0, these issue not happen with same build config

@lambdapioneer
Copy link
Contributor

Hi @hsandyque, you don't need the extra dependency on soloader as it now ships with Fresco since 1.8.0. I'd recommend updating to 1.8.1 as it fixes other bugs.

Your build.gradle file should reference the proguard-fresco.pro file as described in the link that @oprisnik posted.

For clarification: does this bug only happen on that particular device? Is there any adb logcat output that you can share?

@hsandyque
Copy link
Author

Hi @lambdapioneer ,
For clarification: does this bug only happen on that particular device? Is there any adb logcat output that you can share?
Yes, It only happen on OPPO Android 5.1.1 devices (R7sfg / R7g / A51fa)
And the attchments are logcats
1.txt
2.txt

@lambdapioneer
Copy link
Contributor

Hi @hsandyque, given that it only happens with Oppo phones suggests that the way the binary libraries are bundled and the way the phone loads them are not playing nice.

I don't have access to an OPPO phone at the moment and I couldn't find better pointers when searching :/

(a) Does this also happen when installing the showcase app that we have in our repository? (that would bring me closer to debug this once I get hold on an OPPO phone)
(b) Can you provide the output of running unzip -l your_release.apk | grep lib/ on your release APK? That will show which files are actually bundled.

@hsandyque
Copy link
Author

Hi @lambdapioneer,

I don't have an OPPO phone (Android 5.1.1), these issues report from Crashlytics. I don't know if these also happen on showcase app.

And the bundle list as follow
158176 00-00-1980 00:00 lib/arm64-v8a/libgifimage.so 383192 00-00-1980 00:00 lib/arm64-v8a/libimagepipeline.so 3107040 00-00-1980 00:00 lib/arm64-v8a/librealm-jni.so 91980 00-00-1980 00:00 lib/armeabi-v7a/libgifimage.so 255696 00-00-1980 00:00 lib/armeabi-v7a/libimagepipeline.so 1877536 00-00-1980 00:00 lib/armeabi-v7a/librealm-jni.so 100168 00-00-1980 00:00 lib/armeabi/libgifimage.so 313028 00-00-1980 00:00 lib/armeabi/libimagepipeline.so 4058380 00-00-1980 00:00 lib/mips/librealm-jni.so 145240 00-00-1980 00:00 lib/x86/libgifimage.so 452312 00-00-1980 00:00 lib/x86/libimagepipeline.so 3397252 00-00-1980 00:00 lib/x86/librealm-jni.so 150360 00-00-1980 00:00 lib/x86_64/libgifimage.so 477784 00-00-1980 00:00 lib/x86_64/libimagepipeline.so 3336720 00-00-1980 00:00 lib/x86_64/librealm-jni.so

@hsandyque
Copy link
Author

Hi @lambdapioneer,
more log
02-21 15:14:44.524 25391-25537/com.mobix.pinecone E/art: dlopen("/data/data/com.mobix.pinecone/lib-main/libimagepipeline.so", RTLD_LAZY) failed: dlopen failed: "/data/data/com.mobix.pinecone/lib-main/libimagepipeline.so" is 64-bit instead of 32-bit 02-21 15:14:44.524 25391-25537/com.mobix.pinecone E/SoLoader: Could not load: libimagepipeline.so 02-21 15:14:44.537 25391-25537/com.mobix.pinecone E/AndroidRuntime: FATAL EXCEPTION: FrescoIoBoundExecutor-2 Process: com.mobix.pinecone, PID: 25391 java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:522) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:420) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:370) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:335) at com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:42) at com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit>(NativeMemoryChunk.java:33) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58) at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20) at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257) at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.<init>(NativePooledByteBufferOutputStream.java:51) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:98) at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:26) at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:89) at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:101) at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.java:39) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:54) at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50) at com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:45) 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:53) at java.lang.Thread.run(Thread.java:818)

@wangshuwen1107
Copy link

wangshuwen1107 commented Feb 25, 2018

HI @oprisnik
i have same problem how to fix it ?

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so
at com.facebook.soloader.j.b(SourceFile:522)
at com.facebook.soloader.j.a(SourceFile:420)
at com.facebook.soloader.j.a(SourceFile:370)
at com.facebook.soloader.j.a(SourceFile:335)
at com.facebook.imagepipeline.nativecode.a.a(SourceFile:42)
at com.facebook.imagepipeline.memory.NativeMemoryChunk.(SourceFile:33)
at com.facebook.imagepipeline.memory.l.i(SourceFile:58)
at com.facebook.imagepipeline.memory.l.b(SourceFile:20)
at com.facebook.imagepipeline.memory.a.a(SourceFile:257)
at com.facebook.imagepipeline.memory.o.(SourceFile:51)
at com.facebook.imagepipeline.memory.n.b(SourceFile:98)
at com.facebook.imagepipeline.memory.n.a(SourceFile:26)
at com.facebook.imagepipeline.producers.z.a(SourceFile:89)
at com.facebook.imagepipeline.producers.z.b(SourceFile:101)
at com.facebook.imagepipeline.producers.aa.a(SourceFile:34)
at com.facebook.imagepipeline.producers.z$1.d(SourceFile:54)
at com.facebook.imagepipeline.producers.z$1.c(SourceFile:50)
at com.facebook.common.b.e.run(SourceFile:45)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at com.facebook.imagepipeline.d.k$1.run(SourceFile:53)
at java.lang.Thread.run(Thread.java:818)

@erikandre
Copy link
Contributor

@hsandyque

Do you specify any ABI (CPU type) filters in your apps gradle files?

@hsandyque
Copy link
Author

@erikandre
I don't use any ABI filters in my gradle file, and already list the detail setting on previous reply

@csbz17027
Copy link

csbz17027 commented Mar 16, 2018

I use version 1.8.1 also have same problem.The device is VIVO X7(Android 5.1.1,arm64-v8a).

FrescoIoBoundExecutor-2(121704)

java.lang.UnsatisfiedLinkError

com.facebook.imagepipeline.memory.NativeMemoryChunk
1 com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58)

2 com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20)
3 com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257)
4 com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java:51)
5 com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:98)
6 com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:26)
7 com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:89)
8 com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:101)
9 com.facebook.imagepipeline.producers.LocalFileFetchProducer.getEncodedImage(LocalFileFetchProducer.java:34)
10 com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:54)
11 com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50)
12 com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:45)
13 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
14 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
15 com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:53)
16 java.lang.Thread.run(Thread.java:818)

FrescoIoBoundExecutor-1(121150)

java.lang.UnsatisfiedLinkError

couldn't find DSO to load: libimagepipeline.so
1 com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:522)

2 com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:420)
3 com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:370)
4 com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:335)
5 com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:42)
6 com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:33)
7 com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58)
8 com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20)
9 com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257)
10 com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java:51)
11 com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:98)
12 com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newByteBuffer(NativePooledByteBufferFactory.java:26)
13 com.facebook.imagepipeline.cache.BufferedDiskCache.readFromDiskCache(BufferedDiskCache.java:336)
14 com.facebook.imagepipeline.cache.BufferedDiskCache.access$400(BufferedDiskCache.java:36)
15 com.facebook.imagepipeline.cache.BufferedDiskCache$2.call(BufferedDiskCache.java:182)
16 com.facebook.imagepipeline.cache.BufferedDiskCache$2.call(BufferedDiskCache.java:166)
17 bolts.Task$4.run(Task.java:357)
18 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
19 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
20 com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:53)
21 java.lang.Thread.run(Thread.java:818)

@ignaciogs
Copy link

Any fix? This is my log
Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:522)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:420)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:370)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:335)
at com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:42)
at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:33)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:58)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:20)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:257)
at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java:51)
at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newOutputStream(NativePooledByteBufferFactory.java:141)
at com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.newOutputStream(NativePooledByteBufferFactory.java:26)
at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:90)
at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:70)
at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$2.onResponse(OkHttpNetworkFetcher.java:180)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
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)

@ignaciogs
Copy link

image

@hsandyque
Copy link
Author

@wangshuwen1107 @csbz17027 @ignaciogs
Due to Facebook still checking the problem, I found the workaround solution that may temporary fix this issue.

dlopen("/data/data/xxx/lib-main/libimagepipeline.so", RTLD_LAZY) failed: dlopen failed: "/data/data/xxx/lib-main/libimagepipeline.so" is 64-bit instead of 32-bit

The log I found that is these specific devices run app in 32-bit (I don't know why, maybe the framework bug) but the libimagepipeline.so is 64-bit.

Add the api filter as following code snap, skip the "arm64-v8a"
defaultConfig { ... ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "x86_64", "mips", "mips64" } }
It's not the correct solution but maybe it will fix issue at the first and then we waiting the update

@wangshuwen1107
Copy link

@hsandyque thanks a lot ,your response is very helpful,Looking forward to your update!

@hsandyque
Copy link
Author

@oprisnik @erikandre @lambdapioneer
Do you have any idea about how to fix this issue?

@lambdapioneer
Copy link
Contributor

@hsandyque do you load any other dependencies such that the system might be confused with a mix of 32bit and 64bit libraries?

In this case I'd suggest that you go with the following abiFilters line:

abiFilters "armeabi", "armeabi-v7a", "x86", "mips"}

Maybe even drop mips altogether if you don't specifically target a special device.

@siralam
Copy link

siralam commented May 4, 2018

Still having this issue on v1.9.0.

Adding

        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86"
        }

Worked for me. But by reading the above conversation, seems it is not the "correct" solution?

@deltaguita
Copy link

deltaguita commented May 15, 2018

My team has the same issue , has not get so much crash reports (Of cause fresco's OOM) from a 3rd library like this, it's time to say bye bye !

@icemanstudy
Copy link

icemanstudy commented May 15, 2018

i use
ndk { abiFilters "armeabi,armeabi-v7a" }
and
compile 'com.facebook.fresco:fresco:1.8.0' compile 'com.facebook.fresco:animated-gif:1.8.0' compile 'com.facebook.fresco:animated-webp:1.8.0' compile 'com.facebook.fresco:webpsupport:1.8.0'
also have the same crash.

@Freshman111
Copy link

Still have this problem on v1.9.0.

@Sk1talec
Copy link

Still facing that issue on 1.9.0 with supported abis "armeabi", "armeabi-v7a", "x86"

@tantom
Copy link

tantom commented Jun 28, 2018

Still have this problem on v1.9.0.

@midhun-murali
Copy link

midhun-murali commented Jul 3, 2018

I am also having the same issue. My app is crashing on opening. It occurs only on HTC One E9PLUS dual sim running on android 5.0.2
Error : Fatal Exception: java.lang.UnsatisfiedLinkError
couldn't find DSO to load: libimagepipeline.so

@dlackty
Copy link

dlackty commented Jul 10, 2018

UPDATE: For those we got this issue, please do check the production guide on Fresco website, which solves our problem.

@oprisnik
Copy link
Contributor

Can you try with the solution outlined above? #2049 (comment)

@hardapps1692
Copy link

Can you try with the solution outlined above? #2049 (comment)

I have tried this solution still it crashes the app

@yuan89623
Copy link

same issue,I use implementation 'com.facebook.fresco:fresco:2.0.0'

@glovebx
Copy link

glovebx commented Jul 15, 2019

i'm using 'com.facebook.fresco:fresco:2.0.0'.
got same issue on my HUAWEI HORNOR 8 device.
just added
ndk { abiFilters "armeabi", "armeabi-v7a", "x86" }
in defaultConfig resolved my problem.

@palicka
Copy link

palicka commented Jul 26, 2019

same here, it happens basically in every system version 6 and above and most device brands

@FranziscaZarrai
Copy link

i'm using 'com.facebook.fresco:fresco:2.0.0'.
got same issue on my HUAWEI HORNOR 8 device.
just added
ndk { abiFilters "armeabi", "armeabi-v7a", "x86" }
in defaultConfig resolved my problem.

@glovebx You may want to check if limiting to 32Bit won't cause you problems with google's requirements for 64 Bit: https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

From what i understood new apps or updates of existing apps will be required to support 64Bit starting 1.08.2019

@ShawnDongAi
Copy link

I have a compromise solution before this issue fixed.
#2381 (comment)
Hope it can help you

@FranziscaZarrai
Copy link

@ShawnDongAi thank you for sharing this 👍 ! For us it's a bit too late : ) we moved to another image library due to this fresco issue here.

@oprisnik
Copy link
Contributor

facebook/SoLoader#45 should fix some of the issues here. We're also working on making SoLoader optional, so you can use other mechanisms to load native code instead.

@Balajipss
Copy link

Balajipss commented Aug 25, 2019

Using RN 0.60.5 version.
If you guys are wondering why your app crashes if you download it from playstore, make the below changes

packagingOptions {
exclude '/lib/arm64-v8a/libc++_shared.so' (exclude '/lib/arm64-v8a/error_causing_library.so')
exclude '/lib/x86_64/libc++_shared.so' (exclude '/lib/arm64-v8a/error_causing_library.so')

//In pickFirst, replace the library name with the library that is causing error.
pickFirst '/lib/x86/libc++_shared.so' (pickFirst '/lib/x86/error_causing_library.so')
pickFirst '/lib/armeabi-v7a/libc++_shared.so' (pickFirst '/lib/armeabi-v7a/error_causing_library.so')

}

If you do not know which library is causing the crash, upload your bundle in Firebase test lab and then check. It will tell you which library is throwing the error

@waseefakhtar
Copy link

@Balajipss won't excluding all 64-bit libraries cause any problems with Google's 64-bit requirement: https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html ?

@Balajipss
Copy link

Balajipss commented Aug 26, 2019

@waseefakhtar You can make the following changes

packagingOptions {
exclude '/lib/arm64-v8a/libc++_shared.so'
exclude '/lib/x86_64/libc++_shared.so'
pickFirst '/lib/x86/libc++_shared.so'
pickFirst '/lib/armeabi-v7a/libc++_shared.so'
}

@juanimoli
Copy link

Does anyone has a step by step list to reproduce this issue? We're facing it in production but we can't reproduce it locally, even with the same phone that our crash notifier shows.

@waseefakhtar
Copy link

@juanimoli not sure but most of the Oppo devices running OS 5 seems to face the issue.

@juanimoli
Copy link

juanimoli commented Aug 30, 2019

@waseefakhtar I was able to reproduce the issue by compiling the app for "armeabi-v7a" in the device specs json file option of the bundletool (using AppBundle). Installed the app in a supported device and the crash appeared right away.

I was able to fix it by appling 2381#issuecomment-516825599 with no abiFilters or excludes added.

@summerEnd
Copy link

I used fresco 1.13.0 and it was OK all the time. When update to 2.0.0,i got this issue.Then I checked my new apk,I found no libimagepipeline.so in my apk.Then I clean my project,build a new APK.and I have libimagepipeline.so in my new apk. and the problem is fixed,this maybe a issue from android studio!

@cuibg
Copy link

cuibg commented Jan 13, 2020

I have solved this problem in this way!

defaultConfig { ... ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "x86_64", "mips", "mips64" } }

@saiday
Copy link

saiday commented Feb 3, 2020

I update to AndroidX and then all of a sudden I had couldn't find DSO to load: libimagepipeline.so on the local environment, I managed to fix it by copy project to another path.

I have no idea, but guess something with Gradle cache went wrong. (although Gradle cache cleared)

I would like to know the root cause if anyone knows.

@androideveloper
Copy link

Happening on our side after upgrade to Fresco 2.1.0

@RiteshChandnani
Copy link

RiteshChandnani commented Apr 15, 2020

I fixed it by doing the following changes:

implementation('com.facebook.fresco:fresco:2.1.0') {
        exclude group: 'com.facebook.soloader', module: 'soloader'
}
implementation('com.facebook.fresco:imagepipeline-okhttp3:2.1.0') {
        exclude group: 'com.facebook.soloader', module: 'soloader'
}

After this change Fresco will use the native loader rather than soLoader to load any native libraries.

@oprisnik
Copy link
Contributor

You should also add exclude group: 'com.facebook.fresco', module: 'soloader' , see the 2.1.0 release for more details:

https://github.com/facebook/fresco/releases/tag/v2.1.0

@kmrinmoy07
Copy link

I have moved to Fresco from Picasso recently and just launched the updated app on Playstore. Now on its very first day I am seeing this error in my app. The crash was seen on android version 7.1.2 on Trend devices

Screenshot (158)

Is there any working solution available now

@oprisnik
Copy link
Contributor

Potential solutions:

@kmrinmoy07
Copy link

@oprisnik I tried the above 3 solution upgraded to 2.2.0 and tested the app in firebase but during testing I got this error

java.lang.RuntimeException: Unable to create application com.example.xyz.MyApplication: java.lang.RuntimeException: Wrong Native code setup, reflection failed.

only in devices running API 19.

I had used

` implementation('com.facebook.fresco:fresco:2.2.0') {  
  exclude group: 'com.facebook.soloader', module: 'soloader'
  exclude group: 'com.facebook.fresco', module: 'soloader'
  exclude group: 'com.facebook.fresco', module: 'nativeimagefilters'
  exclude group: 'com.facebook.fresco', module: 'nativeimagetranscoder'
  exclude group: 'com.facebook.fresco', module: 'memory-type-native'
  exclude group: 'com.facebook.fresco', module: 'imagepipeline-native' }`

Initialized fresco using

             `Fresco.initialize(
                     getApplicationContext(),
                     ImagePipelineConfig.newBuilder(getApplicationContext())
                    .setMemoryChunkType(MemoryChunkType.BUFFER_MEMORY)
                    .setImageTranscoderType(ImageTranscoderType.JAVA_TRANSCODER)
                    .experiment().setNativeCodeDisabled(true)
                    .build());` 

The full stack trace is

java.lang.RuntimeException: Unable to create application com.example.xyz.MyApplication: java.lang.RuntimeException: Wrong Native code setup, reflection failed.
FATAL EXCEPTION: main
Process: com.example.xyz, PID: 29863
java.lang.RuntimeException: Unable to create application com.example.xyz.MyApplication: java.lang.RuntimeException: Wrong Native code setup, reflection failed.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4423)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Wrong Native code setup, reflection failed.
at com.facebook.imagepipeline.platform.PlatformDecoderFactory.buildPlatformDecoder(PlatformDecoderFactory.java:51)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformDecoder(ImagePipelineFactory.java:312)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformBitmapFactory(ImagePipelineFactory.java:304)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getAnimatedFactory(ImagePipelineFactory.java:164)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getImageDecoder(ImagePipelineFactory.java:227)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerFactory(ImagePipelineFactory.java:327)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerSequenceFactory(ImagePipelineFactory.java:360)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getImagePipeline(ImagePipelineFactory.java:282)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:52)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:43)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:36)
at com.facebook.drawee.backends.pipeline.Fresco.initializeDrawee(Fresco.java:121)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:110)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:54)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:46)
at com.example.xyz.MyApplication.onCreate(MyApplication.java:26)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1030)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4420)
... 10 more
Caused by: java.lang.ClassNotFoundException: com.facebook.imagepipeline.platform.KitKatPurgeableDecoder
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at java.lang.Class.forName(Class.java:216)
at com.facebook.imagepipeline.platform.PlatformDecoderFactory.buildPlatformDecoder(PlatformDecoderFactory.java:44)
... 27 more
Caused by: java.lang.NoClassDefFoundError: com/facebook/imagepipeline/platform/KitKatPurgeableDecoder
... 31 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.imagepipeline.platform.KitKatPurgeableDecoder" on path: DexPathList[[zip file "/data/app/com.example.xyz-1.apk", zip file "/data/data/com.example.xyz/code_cache/secondary-dexes/com.example.xyz-1.apk.classes2.zip", zip file "/data/data/com.example.xyz/code_cache/secondary-dexes/com.example.xyz-1.apk.classes3.zip"],nativeLibraryDirectories=[/data/app-lib/com.example.xyz-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
... 31 more

@alexwan02
Copy link

@wangshuwen1107 @csbz17027 @ignaciogs Due to Facebook still checking the problem, I found the workaround solution that may temporary fix this issue.

dlopen("/data/data/xxx/lib-main/libimagepipeline.so", RTLD_LAZY) failed: dlopen failed: "/data/data/xxx/lib-main/libimagepipeline.so" is 64-bit instead of 32-bit

The log I found that is these specific devices run app in 32-bit (I don't know why, maybe the framework bug) but the libimagepipeline.so is 64-bit.

Add the api filter as following code snap, skip the "arm64-v8a" defaultConfig { ... ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "x86_64", "mips", "mips64" } } It's not the correct solution but maybe it will fix issue at the first and then we waiting the update

This's not a better solution for App that need arm64-v8a

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

No branches or pull requests