Fresco: Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libnative-imagetranscoder.so caused by: dlopen failed: "/data/data/com.degoo.android/lib-main/libnative-imagetranscoder.so" is 64-bit instead of 32-bit

Created on 14 Aug 2019  ·  29Comments  ·  Source: facebook/fresco

Since a similar issue #2339 was closed, I'd like to know if there's solution for the error below:

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libnative-imagetranscoder.so caused by: dlopen failed: "/data/data/com.degoo.android/lib-main/libnative-imagetranscoder.so" is 64-bit instead of 32-bit
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 738(SoLoader.java:738)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName + 591(SoLoader.java:591)
       at com.facebook.soloader.SoLoader.loadLibrary + 529(SoLoader.java:529)
       at com.facebook.soloader.SoLoader.loadLibrary + 484(SoLoader.java:484)
       at com.facebook.imagepipeline.nativecode.NativeJpegTranscoderSoLoader.ensure + 28(NativeJpegTranscoderSoLoader.java:28)
       at com.facebook.imagepipeline.nativecode.NativeJpegTranscoder.(S:47)
       at com.facebook.imagepipeline.nativecode.NativeJpegTranscoderFactory.createImageTranscoder + 35(NativeJpegTranscoderFactory.java:35)
       at com.facebook.imagepipeline.transcoder.MultiImageTranscoderFactory.getNativeImageTranscoder + 70(MultiImageTranscoderFactory.java:70)
       at com.facebook.imagepipeline.transcoder.MultiImageTranscoderFactory.createImageTranscoder + 47(MultiImageTranscoderFactory.java:47)
       at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.onNewResultImpl + 161(ResizeAndRotateProducer.java:161)
       at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.onNewResultImpl + 83(ResizeAndRotateProducer.java:83)
       at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult + 97(BaseConsumer.java:97)
       at com.facebook.imagepipeline.producers.AddImageTransformMetaDataProducer$AddImageTransformMetaDataConsumer.onNewResultImpl + 46(AddImageTransformMetaDataProducer.java:46)
       at com.facebook.imagepipeline.producers.AddImageTransformMetaDataProducer$AddImageTransformMetaDataConsumer.onNewResultImpl + 30(AddImageTransformMetaDataProducer.java:30)
       at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult + 97(BaseConsumer.java:97)
       at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer.onNextResult + 452(MultiplexProducer.java:452)
       at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl + 513(MultiplexProducer.java:513)
       at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl + 506(MultiplexProducer.java:506)
       at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult + 97(BaseConsumer.java:97)
       at com.facebook.imagepipeline.producers.EncodedMemoryCacheProducer$EncodedMemoryCacheConsumer.onNewResultImpl + 166(EncodedMemoryCacheProducer.java:166)
       at com.facebook.imagepipeline.producers.EncodedMemoryCacheProducer$EncodedMemoryCacheConsumer.onNewResultImpl + 111(EncodedMemoryCacheProducer.java:111)
       at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult + 97(BaseConsumer.java:97)
       at com.facebook.imagepipeline.producers.DiskCacheReadProducer$1.then + 107(DiskCacheReadProducer.java:107)
       at com.facebook.imagepipeline.producers.DiskCacheReadProducer$1.then + 88(DiskCacheReadProducer.java:88)
       at bolts.Task$14.run + 872(Task.java:872)
       at bolts.BoltsExecutors$ImmediateExecutor.execute + 105(BoltsExecutors.java:105)
       at bolts.Task.completeImmediately + 863(Task.java:863)
       at bolts.Task.access$000 + 32(Task.java:32)
       at bolts.Task$10.then + 654(Task.java:654)
       at bolts.Task$10.then + 651(Task.java:651)
       at bolts.Task.runContinuations + 956(Task.java:956)
       at bolts.Task.trySetResult + 994(Task.java:994)
       at bolts.TaskCompletionSource.trySetResult + 39(TaskCompletionSource.java:39)
       at bolts.TaskCompletionSource.setResult + 62(TaskCompletionSource.java:62)
       at bolts.Task$4.run + 357(Task.java:357)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1115(ThreadPoolExecutor.java:1115)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 590(ThreadPoolExecutor.java:590)
       at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 51(PriorityThreadFactory.java:51)
       at java.lang.Thread.run + 818(Thread.java:818)

I've tried downgrading my Android Gradle plugin with the https://github.com/facebook/SoLoader/issues/29#issuecomment-492929087 suggestion but that gives me build errors about compatibility issues with androidx dependencies like:

Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution

After fixing them, I get an exception related to Dagger:

e: [kapt] An exception occurred: java.util.NoSuchElementException
    at com.sun.tools.javac.util.List$2.next(List.java:432)
    at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:302)
    at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:254)
    at dagger.android.processor.AndroidMapKeys.mapKeyValue(AndroidMapKeys.java:75)
    at dagger.android.processor.AndroidMapKeys.lambda$annotationsAndFrameworkTypes$5(AndroidMapKeys.java:56)
    at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)

So I really don't want to downgrade my Android Gradle plugin. Also, we've only noticed the error after making our app support 64-bit architecture, so it makes more sense the error is related with architecture rather the Android Gradle plugin.

The error mostly occurs on Oppo and Android 5.1.1:

Screen Shot 2019-08-14 at 7 29 12 PM

Any idea how this could be solved?

stale

All 29 comments

Yeah, looks like some Oppo devices don't properly handle 64 bit SO files :(

@oprisnik that's odd, yes. Is there a workaround to fix this besides downgrading the Android Gradle plugin?

Can you try the suggestions mentioned in https://github.com/facebook/react-native/issues/25490 ? Looks like that fixed the issue for some folks.

I try to do like this:

    try {
        ReLinker.loadLibrary(context, "imagepipeline");
    } catch (Throwable ex) {

        Fresco.shutDown();
        builder.experiment().setNativeCodeDisabled(true);
        ImagePipelineConfig configEx = builder.build();
        Fresco.initialize(context, configEx);
        if (!Fresco.hasBeenInitialized()) {
            Fresco.initialize(context);
        }
        if (ex != null)
            Z.e("FrescoHelper", "initFresco link imagepipeline.so throwable: " + ex.toString());

    }
    try {
        NativeJpegTranscoderSoLoader.ensure();
    } catch (Throwable ex) {
        Field field;
        try {
            field = NativeJpegTranscoderSoLoader.class.getDeclaredField("sInitialized");
            field.setAccessible(true);
            field.setBoolean(NativeJpegTranscoderSoLoader.class, true);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

But I hava a other Exception :

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libnative-filters.so caused by: dlopen failed: "/data/data/sg.cocofun/lib-main/libnative-filters.so" is 64-bit instead of 32-bit
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 738(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName + 591(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary + 529(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary + 484(SoLoader.java:484)
at com.facebook.imagepipeline.nativecode.NativeFiltersLoader.load + 16(NativeFiltersLoader.java:16)
at com.facebook.imagepipeline.nativecode.NativeBlurFilter.(SourceFile:21)
at com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor.process + 45(IterativeBoxBlurPostProcessor.java:45)
at com.facebook.imagepipeline.request.BasePostprocessor.process + 85(BasePostprocessor.java:85)
at com.facebook.imagepipeline.request.BasePostprocessor.process + 61(BasePostprocessor.java:61)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.postprocessInternal + 247(PostprocessorProducer.java:247)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.doPostprocessing + 217(PostprocessorProducer.java:217)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.onNewResultImpl + 73(PostprocessorProducer.java:73)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer$2.run + 175(PostprocessorProducer.java:175)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1115(ThreadPoolExecutor.java:1115)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 590(ThreadPoolExecutor.java:590)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 51(PriorityThreadFactory.java:51)
at java.lang.Thread.run + 818(Thread.java:818)

Can you try the suggestions mentioned in facebook/react-native#25490 ? Looks like that fixed the issue for some folks.

@oprisnik I tried the suggestion by making changes to packagingOptions like here which now throws an exception saying /libimagepipeline.so" is 32-bit instead of 64-bit instead of the other way around (I mean, I can reproduce it even on an emulator and not just on an Oppo device):

2019-08-20 15:40:03.430 14786-15049/com.degoo.android.dev W/System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so caused by: dlopen failed: "/data/data/com.degoo.android.dev/lib-main/libimagepipeline.so" is 32-bit instead of 64-bit com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738) 
com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591) 
com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529) 
com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484) 
com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:40) 
com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit>(NativeMemoryChunk.java:31
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:25)
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:13) 
com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:267)
com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init (MemoryPooledByteBufferOutputStream.java:51) com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:73) 
com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:24) 
com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:85) 
com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:97) 
com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.java:37) 
com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50) com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:46) 
com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:43) 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51) java.lang.Thread.run(Thread.java:919)

But I hava a other Exception :

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libnative-filters.so caused by: dlopen failed: "/data/data/sg.cocofun/lib-main/libnative-filters.so" is 64-bit instead of 32-bit
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 738(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName + 591(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary + 529(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary + 484(SoLoader.java:484)
at com.facebook.imagepipeline.nativecode.NativeFiltersLoader.load + 16(NativeFiltersLoader.java:16)
at com.facebook.imagepipeline.nativecode.NativeBlurFilter.(SourceFile:21)
at com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor.process + 45(IterativeBoxBlurPostProcessor.java:45)
at com.facebook.imagepipeline.request.BasePostprocessor.process + 85(BasePostprocessor.java:85)
at com.facebook.imagepipeline.request.BasePostprocessor.process + 61(BasePostprocessor.java:61)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.postprocessInternal + 247(PostprocessorProducer.java:247)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.doPostprocessing + 217(PostprocessorProducer.java:217)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer.onNewResultImpl + 73(PostprocessorProducer.java:73)
at com.facebook.imagepipeline.producers.PostprocessorProducer$PostprocessorConsumer$2.run + 175(PostprocessorProducer.java:175)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1115(ThreadPoolExecutor.java:1115)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 590(ThreadPoolExecutor.java:590)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 51(PriorityThreadFactory.java:51)
at java.lang.Thread.run + 818(Thread.java:818)

@Yonghejiunian Is it specific to one device or many devices? Also, can you reproduce it yourself?

@oprisnik could you merge https://github.com/facebook/react-native/issues/25490#issuecomment-522968429 and release a new version for Fresco?

Thanks. We're on it. I've imported the PR.

Anyone has fixed this issue?

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.

Hi @oprisnik, I wonder if there's any update on this yet. When can we expect a new release with a fix?

HI,This is a problem in 2016, it has not been resolved; facebook developers are not fixing this problem; I can only be forced to use glide;Pealse hlep me. thanks you

The pull request is still under review. Once that's available, we can do a new release.

We also have a new native library loading interface in the works where you can use any other native loading library (e.g. system one).

Thanks for the update! Looking forward.

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.

Quick update: We are going to make some slight adjustments to the new native loading API, before doing a new release.

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.

Quick update: We are going to make some slight adjustments to the new native loading API, before doing a new release.

Looking forward!

hi, guys, in my OPPO R9m, ColorOS v3.0, android 5.1, has the same issue, and gradle is:

implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.facebook.fresco:animated-gif:1.9.0'
...
ndk {abiFilters "armeabi-v7a", "arm64-v8a"}

and i downgrade the fresco version to 0.12.0, animated-gif to 0.12.0, like this:
implementation 'com.facebook.fresco:fresco:0.12.0'
implementation 'com.facebook.fresco:animated-gif:0.12.0'

it works well now!

---- i had try 1.5.0,1.4.0 they are all ok!

@zung downgrading is okay, but Fresco is about to launch a new release with the fix as well as making some slight adjustments to the new native loading API, like mentioned here: https://github.com/facebook/fresco/issues/2393#issuecomment-530821873

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.

Fresco is about to launch a new release with the fix

About to?

Yes, sorry for the delays. Getting the Java Fresco version ready took a bit longer than expected. A new release will be available soon.

In the meantime, you should be able to force the SoLoader version to be 0.8.0.

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.

是的,对不起您的延迟。准备好Java Fresco版本花费的时间比预期的要长一点。新版本即将推出。

同时,您应该可以将SoLoader版本强制为0.8.0

Has the Fresco new version been released?

Yes, please use Fresco 2.1.0.

Yes, please use Fresco 2.1.0.

Thanks, I will upgrade the use

Was this page helpful?
0 / 5 - 0 ratings