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

UnsatisfiedLinkError: couldn't find "libmemchunk.so" #410

Closed
xiaoluome opened this Issue Jun 29, 2015 · 48 comments

Comments

Projects
None yet
@xiaoluome

xiaoluome commented Jun 29, 2015

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.blink.academy.fork-1/base.apk"],nativeLibraryDirectories=[/data/app/com.blink.academy.fork-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libmemchunk.so"
    at java.lang.Runtime.loadLibrary(Runtime.java:366)
    at java.lang.System.loadLibrary(System.java:989)
    at com.facebook.common.soloader.SoLoaderShim$DefaultHandler.loadLibrary(SoLoaderShim.java:34)
    at com.facebook.common.soloader.SoLoaderShim.loadLibrary(SoLoaderShim.java:56)
    at com.facebook.imagepipeline.memory.NativeMemoryChunk.(NativeMemoryChunk.java:36)
    at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:60)
    at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:22)
    at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:260)
    at com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.(NativePooledByteBufferOutputStream.java:53)
    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:95)
    at com.facebook.imagepipeline.producers.NetworkFetchProducer.access$000(NetworkFetchProducer.java:36)
    at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:73)
    at com.blink.academy.fork.fresco.imagepipeline.OkHttpNetworkFetcher$2.onResponse(OkHttpNetworkFetcher.java:96)
    at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)
    at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
    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)
@TarangS

This comment has been minimized.

Show comment
Hide comment
@TarangS

TarangS Jun 30, 2015

Contributor

http://frescolib.org/docs/multiple-apks.html
Are you using the split for 64 bit as mentioned in the link.

Contributor

TarangS commented Jun 30, 2015

http://frescolib.org/docs/multiple-apks.html
Are you using the split for 64 bit as mentioned in the link.

@binqiangsun

This comment has been minimized.

Show comment
Hide comment
@binqiangsun

binqiangsun Sep 15, 2015

@TarangS I used the split for 64 like the link said. and got the error as mentioned. what can I do ?

binqiangsun commented Sep 15, 2015

@TarangS I used the split for 64 like the link said. and got the error as mentioned. what can I do ?

@tyronen tyronen removed the needs-details label Sep 22, 2015

@tyronen

This comment has been minimized.

Show comment
Hide comment
@tyronen

tyronen Sep 23, 2015

Contributor

Are you experiencing this on all devices or just on 64-bit?

Contributor

tyronen commented Sep 23, 2015

Are you experiencing this on all devices or just on 64-bit?

@binqiangsun

This comment has been minimized.

Show comment
Hide comment
@binqiangsun

binqiangsun Sep 29, 2015

@tyronen I want all devices installed without 64-bit libs. Is this possible?

binqiangsun commented Sep 29, 2015

@tyronen I want all devices installed without 64-bit libs. Is this possible?

@satyarths

This comment has been minimized.

Show comment
Hide comment
@satyarths

satyarths Nov 5, 2015

Contributor

I get the same error,And I have added the fresco proguard lines. It occcurs on 4.4.2,4.2.2 and 4.2.1 on
Mediatek MT6589, and Mediatek MT6572(Dual-core 1.3 GHz Cortex-A7)

Contributor

satyarths commented Nov 5, 2015

I get the same error,And I have added the fresco proguard lines. It occcurs on 4.4.2,4.2.2 and 4.2.1 on
Mediatek MT6589, and Mediatek MT6572(Dual-core 1.3 GHz Cortex-A7)

@tyronen

This comment has been minimized.

Show comment
Hide comment
@tyronen

tyronen Nov 5, 2015

Contributor

see also details in #732

Contributor

tyronen commented Nov 5, 2015

see also details in #732

@gchudnov

This comment has been minimized.

Show comment
Hide comment
@gchudnov

gchudnov Nov 5, 2015

Bumped into the same issue.

Previously the app worked fine.
The directory /data/app/{APP_NAME}/lib is empty indeed.

Not sure, but it might be related to to multidex(?) config.
I'll try to rollback my config and provide more details

gchudnov commented Nov 5, 2015

Bumped into the same issue.

Previously the app worked fine.
The directory /data/app/{APP_NAME}/lib is empty indeed.

Not sure, but it might be related to to multidex(?) config.
I'll try to rollback my config and provide more details

@nikslushkin

This comment has been minimized.

Show comment
Hide comment
@nikslushkin

nikslushkin Nov 5, 2015

Our application have been using fresco for 3 month and last release was month ago. But on Oct 30 we got first crash report and lots of crashes in subsequent days. We do not use proguard and multidex. (see report #732 )

nikslushkin commented Nov 5, 2015

Our application have been using fresco for 3 month and last release was month ago. But on Oct 30 we got first crash report and lots of crashes in subsequent days. We do not use proguard and multidex. (see report #732 )

@satyarths

This comment has been minimized.

Show comment
Hide comment
@satyarths

satyarths Nov 5, 2015

Contributor

Same here.the gradle file indicates compile('com.facebook.fresco:fresco:0.6.1+') . I have to check the release versions once

EDIT : using 0.6.1

Contributor

satyarths commented Nov 5, 2015

Same here.the gradle file indicates compile('com.facebook.fresco:fresco:0.6.1+') . I have to check the release versions once

EDIT : using 0.6.1

@gchudnov

This comment has been minimized.

Show comment
Hide comment
@gchudnov

gchudnov Nov 5, 2015

The problem can be reproduced when using com.android.tools.build:gradle:1.5.0-beta1
In this case the directory /data/app/{APP_NAME}/lib is empty

When rolled back to the previous version, com.android.tools.build:gradle:1.4.0-beta6
everything is OK and /data/app/{APP_NAME}/lib is NOT empty after installation.

gchudnov commented Nov 5, 2015

The problem can be reproduced when using com.android.tools.build:gradle:1.5.0-beta1
In this case the directory /data/app/{APP_NAME}/lib is empty

When rolled back to the previous version, com.android.tools.build:gradle:1.4.0-beta6
everything is OK and /data/app/{APP_NAME}/lib is NOT empty after installation.

@satyarths

This comment has been minimized.

Show comment
Hide comment
@satyarths

satyarths Nov 6, 2015

Contributor

This is not specific to the beta versions:
I am using quite an old setup : Fresco: 0.6.1 and com.android.tools.build:gradle:1.3.0

Contributor

satyarths commented Nov 6, 2015

This is not specific to the beta versions:
I am using quite an old setup : Fresco: 0.6.1 and com.android.tools.build:gradle:1.3.0

@satyarths

This comment has been minimized.

Show comment
Hide comment
@satyarths

satyarths Nov 12, 2015

Contributor

Any solution for this yet?

Contributor

satyarths commented Nov 12, 2015

Any solution for this yet?

@michalgr

This comment has been minimized.

Show comment
Hide comment
@michalgr

michalgr Nov 12, 2015

Contributor

Let's try to figure out what is going on here. Could you please unzip your apk and examine content of lib directory ? Things that would be suspicious:

  • lib directory in the apk is empty
  • lib directory contains multiple subdirectories and not all of them contain libmemchunk.so
Contributor

michalgr commented Nov 12, 2015

Let's try to figure out what is going on here. Could you please unzip your apk and examine content of lib directory ? Things that would be suspicious:

  • lib directory in the apk is empty
  • lib directory contains multiple subdirectories and not all of them contain libmemchunk.so

@michalgr michalgr self-assigned this Nov 12, 2015

@mozes-pb

This comment has been minimized.

Show comment
Hide comment
@mozes-pb

mozes-pb Nov 12, 2015

Hi @michalgr

I also got this error, and here's the content of the libs folder.
screen shot 2015-11-13 at 6 14 33 am
screen shot 2015-11-13 at 6 14 45 am

I noticed that there are no libmemchunk.so in the MIPS folder. could this be the issue?
and to give you some insights, here's the crash readings from new relic.
screen shot 2015-11-13 at 6 17 17 am

Crash info:
java.lang.UnsatisfiedLinkError
SoLoaderShim.java line 32 in SoLoaderShim$DefaultHandler.loadLibrary()
Couldn't load memchunk from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/43b92bc1341988f8ff3dd1c990171a05.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]: findLibrary returned null

mozes-pb commented Nov 12, 2015

Hi @michalgr

I also got this error, and here's the content of the libs folder.
screen shot 2015-11-13 at 6 14 33 am
screen shot 2015-11-13 at 6 14 45 am

I noticed that there are no libmemchunk.so in the MIPS folder. could this be the issue?
and to give you some insights, here's the crash readings from new relic.
screen shot 2015-11-13 at 6 17 17 am

Crash info:
java.lang.UnsatisfiedLinkError
SoLoaderShim.java line 32 in SoLoaderShim$DefaultHandler.loadLibrary()
Couldn't load memchunk from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/app/43b92bc1341988f8ff3dd1c990171a05.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]: findLibrary returned null

@michalgr

This comment has been minimized.

Show comment
Hide comment
@michalgr

michalgr Nov 12, 2015

Contributor

Yep, that would cause the crash on MIPS devices. Do you have a breakdown by the processor architecture ?

Contributor

michalgr commented Nov 12, 2015

Yep, that would cause the crash on MIPS devices. Do you have a breakdown by the processor architecture ?

@mozes-pb

This comment has been minimized.

Show comment
Hide comment
@mozes-pb

mozes-pb Nov 13, 2015

@michalgr ,You mean the breakdown in the new relic report?
No, we don't have that. Can only see the name of the devices.

but if we google the devices, most of them are using MediaTek Processors
MT6572 / MT 6582

mozes-pb commented Nov 13, 2015

@michalgr ,You mean the breakdown in the new relic report?
No, we don't have that. Can only see the name of the devices.

but if we google the devices, most of them are using MediaTek Processors
MT6572 / MT 6582

@satyarths

This comment has been minimized.

Show comment
Hide comment
@satyarths

satyarths Nov 13, 2015

Contributor

My findings are the same as @mozes-pb , MeditaTek causes the issue

Contributor

satyarths commented Nov 13, 2015

My findings are the same as @mozes-pb , MeditaTek causes the issue

@milkiway

This comment has been minimized.

Show comment
Hide comment
@milkiway

milkiway Nov 16, 2015

I think this issue is very similar to this one related to realm.io realm/realm-java#1421 Unfortunately, I can't use realm and fresco in my project with gradle plugins 1.4 and 1.5. Realm supports 1.5.0-beta1, but does not support 1.4.0-beta6. Fresco supports 1.4.0-beta6, but does not 1.5.0-beta1.

milkiway commented Nov 16, 2015

I think this issue is very similar to this one related to realm.io realm/realm-java#1421 Unfortunately, I can't use realm and fresco in my project with gradle plugins 1.4 and 1.5. Realm supports 1.5.0-beta1, but does not support 1.4.0-beta6. Fresco supports 1.4.0-beta6, but does not 1.5.0-beta1.

@nikslushkin

This comment has been minimized.

Show comment
Hide comment
@nikslushkin

nikslushkin Nov 17, 2015

We've done nothing with this issue, but number of crashes has decreased. What's happening?
2015-11-17 14 08 36

nikslushkin commented Nov 17, 2015

We've done nothing with this issue, but number of crashes has decreased. What's happening?
2015-11-17 14 08 36

@songnick

This comment has been minimized.

Show comment
Hide comment
@songnick

songnick Mar 22, 2016

i experience this problem on Huawei 4.1 and Fresco 0.9.0 and the problem is below:

java.lang.NoClassDefFoundError: com/facebook/imagepipeline/nativecode/JpegTranscoder

and lib "libwebp" can not loaded

finally I add this code, there will be OK:
static{ System.loadLibrary("webp"); System.loadLibrary("imagepipeline") }
before use Fresco

songnick commented Mar 22, 2016

i experience this problem on Huawei 4.1 and Fresco 0.9.0 and the problem is below:

java.lang.NoClassDefFoundError: com/facebook/imagepipeline/nativecode/JpegTranscoder

and lib "libwebp" can not loaded

finally I add this code, there will be OK:
static{ System.loadLibrary("webp"); System.loadLibrary("imagepipeline") }
before use Fresco

@ivanviragine

This comment has been minimized.

Show comment
Hide comment
@ivanviragine

ivanviragine Mar 30, 2016

After all, what's the right solution?

static{ System.loadLibrary("webp"); System.loadLibrary("imagepipeline") }

OR

static { SoLoaderShim.loadLibrary("webp"); }

?

I can't simulate the error here, so I don't know what's really working!

ivanviragine commented Mar 30, 2016

After all, what's the right solution?

static{ System.loadLibrary("webp"); System.loadLibrary("imagepipeline") }

OR

static { SoLoaderShim.loadLibrary("webp"); }

?

I can't simulate the error here, so I don't know what's really working!

@songnick

This comment has been minimized.

Show comment
Hide comment
@songnick

songnick Mar 31, 2016

what's your problem, and you can attach your log

songnick commented Mar 31, 2016

what's your problem, and you can attach your log

@guvd

This comment has been minimized.

Show comment
Hide comment
@guvd

guvd Mar 31, 2016

What is the solution?

guvd commented Mar 31, 2016

What is the solution?

@ivanviragine

This comment has been minimized.

Show comment
Hide comment
@ivanviragine

ivanviragine Mar 31, 2016

My problem were:

At:

at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.doTransform(ResizeAndRotateProducer.java)

...

java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libwebp.so" needed by "libimagepipeline.so"; caused by load_library(linker.cpp:746): library "libwebp.so" not found

Got it fixed using this on my Application, before Fresco.initialize(this):

static { try { SoLoaderShim.loadLibrary("webp"); } catch(UnsatisfiedLinkError nle) { } }

ivanviragine commented Mar 31, 2016

My problem were:

At:

at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.doTransform(ResizeAndRotateProducer.java)

...

java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libwebp.so" needed by "libimagepipeline.so"; caused by load_library(linker.cpp:746): library "libwebp.so" not found

Got it fixed using this on my Application, before Fresco.initialize(this):

static { try { SoLoaderShim.loadLibrary("webp"); } catch(UnsatisfiedLinkError nle) { } }

@aagnes

This comment has been minimized.

Show comment
Hide comment
@aagnes

aagnes Apr 13, 2016

Contributor

Can you try with the solution in #933?

Contributor

aagnes commented Apr 13, 2016

Can you try with the solution in #933?

@marco-manza

This comment has been minimized.

Show comment
Hide comment
@marco-manza

marco-manza Apr 27, 2016

Fixed as well with solution described by @ivanviragine

marco-manza commented Apr 27, 2016

Fixed as well with solution described by @ivanviragine

@vikramkakkar

This comment has been minimized.

Show comment
Hide comment
@vikramkakkar

vikramkakkar May 5, 2016

@ivanviragine's solution works for me. But, the following are a bit unsettling:

  1. Can someone confirm if this is a proper fix or just a fix for the device I was seeing this issue on.
  2. What's strange is that I don't use any webp formatted images in my app (I double-checked). So, I don't get why I'm seeing this issue.
  3. I did not (and still don't) have com.facebook.fresco:webpsupport as a dependency. Doesn't @ivanviragine's solution depend on its inclusion?

Moving from 0.9.0 to 0.10.0 fixed this issue out of the box. @ivanviragine's snippet was not required. Neither was com.facebook.fresco:webpsupport.

vikramkakkar commented May 5, 2016

@ivanviragine's solution works for me. But, the following are a bit unsettling:

  1. Can someone confirm if this is a proper fix or just a fix for the device I was seeing this issue on.
  2. What's strange is that I don't use any webp formatted images in my app (I double-checked). So, I don't get why I'm seeing this issue.
  3. I did not (and still don't) have com.facebook.fresco:webpsupport as a dependency. Doesn't @ivanviragine's solution depend on its inclusion?

Moving from 0.9.0 to 0.10.0 fixed this issue out of the box. @ivanviragine's snippet was not required. Neither was com.facebook.fresco:webpsupport.

@ivanviragine

This comment has been minimized.

Show comment
Hide comment
@ivanviragine

ivanviragine May 6, 2016

@vikramkakkar

  1. I don't know the source code, so I don't know 100% about it, but our clients are not complaining and not reporting errors anymore, and there are more than 30k users! So, I think it fixes for a lot of devices!
  2. Sounds like a lib init problem, so it doesn't really depends on wether you are using it or not
  3. Nope, my dependencies are:

compile('com.facebook.fresco:fresco:0.9.0+') { exclude module: 'bolts-android' } compile('com.facebook.fresco:imagepipeline-okhttp:0.9.0+') { exclude module: 'bolts-android' } compile('jp.wasabeef:fresco-processors:2.0.0') { exclude module: 'bolts-android' }

ivanviragine commented May 6, 2016

@vikramkakkar

  1. I don't know the source code, so I don't know 100% about it, but our clients are not complaining and not reporting errors anymore, and there are more than 30k users! So, I think it fixes for a lot of devices!
  2. Sounds like a lib init problem, so it doesn't really depends on wether you are using it or not
  3. Nope, my dependencies are:

compile('com.facebook.fresco:fresco:0.9.0+') { exclude module: 'bolts-android' } compile('com.facebook.fresco:imagepipeline-okhttp:0.9.0+') { exclude module: 'bolts-android' } compile('jp.wasabeef:fresco-processors:2.0.0') { exclude module: 'bolts-android' }

@vikramkakkar

This comment has been minimized.

Show comment
Hide comment
@vikramkakkar

vikramkakkar May 10, 2016

@ivanviragine Thanks for your help! We're not seeing any issues after adding your fix.

vikramkakkar commented May 10, 2016

@ivanviragine Thanks for your help! We're not seeing any issues after adding your fix.

@pookie13

This comment has been minimized.

Show comment
Hide comment
@pookie13

pookie13 Jun 8, 2016

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load libpjsua.so from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.piyush.demopjsua-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.piyush.demopjsua-1, /vendor/lib, /system/lib]]]: findLibrary returned null

please help me in that

i have files in libs folder of .apk file

pookie13 commented Jun 8, 2016

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load libpjsua.so from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.piyush.demopjsua-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.piyush.demopjsua-1, /vendor/lib, /system/lib]]]: findLibrary returned null

please help me in that

i have files in libs folder of .apk file

@zhichaoZhang

This comment has been minimized.

Show comment
Hide comment
@zhichaoZhang

zhichaoZhang Jun 27, 2016

error:java.lang.UnsatisfiedLinkError,crash on mips cpu

zhichaoZhang commented Jun 27, 2016

error:java.lang.UnsatisfiedLinkError,crash on mips cpu

@KirillMakarov

This comment has been minimized.

Show comment
Hide comment
@KirillMakarov

KirillMakarov Aug 12, 2016

same error when transfer the app to sd and vice versa

KirillMakarov commented Aug 12, 2016

same error when transfer the app to sd and vice versa

@sheat2500

This comment has been minimized.

Show comment
Hide comment
@sheat2500

sheat2500 Sep 4, 2016

what's the solution of this issue? got tons of crash report from this related issue.

sheat2500 commented Sep 4, 2016

what's the solution of this issue? got tons of crash report from this related issue.

@peacepassion

This comment has been minimized.

Show comment
Hide comment
@peacepassion

peacepassion Sep 5, 2016

We also have this problem and fail to reproduce the issue.
image

The device info is :
image

And our build config is:
image
image

peacepassion commented Sep 5, 2016

We also have this problem and fail to reproduce the issue.
image

The device info is :
image

And our build config is:
image
image

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