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

java.lang.UnsatisfiedLinkError: on 64 bit devices #305

Open
sw-tt-niravbhavsar opened this issue Sep 1, 2015 · 30 comments
Open

java.lang.UnsatisfiedLinkError: on 64 bit devices #305

sw-tt-niravbhavsar opened this issue Sep 1, 2015 · 30 comments

Comments

@sw-tt-niravbhavsar
Copy link

Hello,

I have created demo and found below error on 64-bit devices,
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.pckgname.live-2/base.apk"],nativeLibraryDirectories=[/data/app/com.pckgname.live-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libvinit.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at io.vov.vitamio.Vitamio.(Vitamio.java:258)
at io.vov.vitamio.LibsChecker.checkVitamioLibs(LibsChecker.java:40)
at com.pckgname.activity.LoadingActivity.onCreate(LoadingActivity.java:221)
at android.app.Activity.performCreate(Activity.java:6500)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Note: Its working fine on 32 bit devices.

Help will be appreciated.

Thanks.

@solarknight
Copy link

I meet the same error with my project. But when I run the offical demo, everything goes well. Hopes for solution.

@solarknight
Copy link

BTW: When I copy the '/data/app/io.vov.vitamio.demo-1/lib/libvinit.so' to my app's corresponding folder,the error changes to below messages.
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/fresh.qunar.com.qtown-2/lib/arm64/libvinit.so" is 32-bit instead of 64-bit
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:989)
at io.vov.vitamio.Vitamio.(Vitamio.java:258)
at io.vov.vitamio.LibsChecker.checkVitamioLibs(LibsChecker.java:40)
at .....

@sw-tt-niravbhavsar
Copy link
Author

By Reviewing below link, i just give up with this error and handled this error in try/catch and play video using default android video api. Assuming that 64 bit device will have enough codecs that can play almost videos. So for 32 bit devices app will play videos using Vitamio and for 64 bit have to play using default android player.

https://www.vitamio.org/en/docs/FAQ/2013/0509/14.html

Still looking forward for solution for Vitamio Library.

@solarknight
Copy link

Hi, I searched on the net these days and finally found the solution!
If you are using Android studio, just edit the gradle.properties in the root folder and add android.useDeprecatedNdk=true. Then edit the build.gradle file in your app's folder, set abiFilters as below:

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

For more information, you can see How to use 32-bit native libaries on 64-bit Android device, how to use 32bit native libraries on 64 bit Android-L platform on stackoverflow.

@sw-tt-niravbhavsar
Copy link
Author

Thanks Very much!!

Worked for me :)

@thduc89
Copy link

thduc89 commented Oct 28, 2015

Big thanks to ThanosZhou you saved my day! Your solution works perfectly (y)

@sungerk
Copy link

sungerk commented Nov 21, 2015

I use ThanosZhou’ solution

my build.gradle is:

apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    defaultConfig
    ndk {
        abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
    }

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets {
    main {
        jniLibs.srcDirs = ['lib']
    }
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}

but is still has bug
Process: sunger.org.demo, PID: 23186
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/sunger.org.demo-1/base.apk"],nativeLibraryDirectories=[/data/app/sunger.org.demo-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libvinit.so"

@solarknight
Copy link

Maybe you should use it in your application module, like this

apply plugin: 'com.android.application'

If it still doesn't work, I have no idea.

@ghost
Copy link

ghost commented Nov 23, 2015

this problem Caused by the fresco

like this issue
realm/realm-java#1092

I didn't find a solution

@Hanqing
Copy link

Hanqing commented Dec 5, 2015

Thanks, ThanosZhou. Worked for me.

@liuxu0703
Copy link

i spend a whole day to solve the problem. i browsed this answer before the end of the day.
works for me! can not thank you more.

@joy-jianqiang
Copy link

Works for me, Thanks. But i don't understand why it's fine in the vitamio demo. Here is my log:
ror loading libs
java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/data/reach.junction.funnystory/lib/libstlport_shared.so" not found
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:981)
at io.vov.vitamio.MediaPlayer.(MediaPlayer.java:264)
at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:430)
at io.vov.vitamio.widget.VideoView.access$1400(VideoView.java:69)
at io.vov.vitamio.widget.VideoView$3.surfaceCreated(VideoView.java:161)
at android.view.SurfaceView.updateWindow(SurfaceView.java:675)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:202)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2449)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1329)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6780)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:826)
at android.view.Choreographer.doCallbacks(Choreographer.java:622)
at android.view.Choreographer.doFrame(Choreographer.java:591)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:812)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5692)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)

@MythodeaLoL
Copy link

@joy-jianqiang try replacing the libarm.so and see what happens.

@ysnows
Copy link

ysnows commented Jan 19, 2016

Big thanks to ThanosZhou ,非常好

@shainsingh89
Copy link

Thank you so much ThonosZhou

@KingJA
Copy link

KingJA commented May 10, 2016

thanks ThonosZhou.

@103style
Copy link

103style commented May 13, 2016

thanks ThonosZhou.
i modify my app bulid.gradle like this, it's works

android {
    defaultConfig {

//add this
        ndk {
            abiFilters "armeabi"
        }
    }

}

@ArrowCross
Copy link

Still have the same error even with Zhou's workaround.
They all happened on some specific devices, but the rest ones works well.
It seems like being caused by importing Look4 map sdks.
Still struggling with it.

@raghavendrav6
Copy link

Thank you @ThanosZhou. It worked.

@chenlei200887
Copy link

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shangliuchina.app-

1/base.apk"],nativeLibraryDirectories=[/data/app/com.shangliuchina.app-1/lib/arm64, /vendor/lib64, /system/lib64]]]

couldn't find "libijkffmpeg.so"

@MythodeaLoL
Copy link

@chenlei200887 here is vitamio, not ijkplayer dude :/

@chenlei200887
Copy link

thankyou My project is wooked来自我的华为手机-------- 原始邮件 --------主题:Re: [yixia/VitamioBundle] java.lang.UnsatisfiedLinkError: on 64 bit devices (#305)发件人:Ranny 收件人:yixia/VitamioBundle 抄送:chenlei200887 13590578268@163.com,Mention @chenlei200887 here is vitamio, not ijkplayer dude :/

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/yixia/VitamioBundle","title":"yixia/VitamioBundle","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/yixia/VitamioBundle"}},"updates":{"snippets":[{"icon":"PERSON","message":"@FloridaStream in #305: @chenlei200887 here is vitamio, not ijkplayer dude :/"}],"action":{"name":"View Issue","url":"https://github.com/yixia/VitamioBundle/issues/305#issuecomment-241227763"}}}

@MythodeaLoL
Copy link

@chenlei200887 you already know is not it? The vitamio are some problems, so it's safer to use the ijkplayer.
ijkplayer have a full code opensource and active dev/support. =) good luck. 🍀

@chenlei200887
Copy link

thanks来自我的华为手机-------- 原始邮件 --------主题:Re: [yixia/VitamioBundle] java.lang.UnsatisfiedLinkError: on 64 bit devices (#305)发件人:Ranny 收件人:yixia/VitamioBundle 抄送:chenlei200887 13590578268@163.com,Mention @chenlei200887 you already know is not it? The vitamio are some problems, so it's safer to use the ijkplayer.
ijkplayer have a full code opensource and active dev/support. =) good luck. 🍀

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/yixia/VitamioBundle","title":"yixia/VitamioBundle","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/yixia/VitamioBundle"}},"updates":{"snippets":[{"icon":"PERSON","message":"@FloridaStream in #305: @chenlei200887 you already know is not it? The vitamio are some problems, so it's safer to use the ijkplayer. \r\nijkplayer have a full code opensource and active dev/support. =) good luck. 🍀 "}],"action":{"name":"View Issue","url":"https://github.com/yixia/VitamioBundle/issues/305#issuecomment-241235704"}}}

@nickming
Copy link

i suggest you use Relinker

@lizwangying
Copy link

love you ,thx! work for me too!!! 😄

@alenart1
Copy link

I know this is a very old thread, but I just wanted to say what a life saver this is. I was about to give up on it.
It's still a very pertinent fix, as I was using the new Android Studio 3 beta 5.
I was facing the lib not found error as well. It seems that unless specified (at least for my 64 bit phone target), it will default to only looking for a 64 bit version of the jni lib.so file. So once I specified 32 bit in the ABI filters, it worked fine. Cheers!

@mexomagno
Copy link

Thanks for this. I just came across this problem and @solarknight 's solution worked. @alenart1 's explanation helped too!

@imnvs
Copy link

imnvs commented Apr 18, 2018

These files are missing in the latest sinch library. Only .aar file is visible in the zip file. Any solution? Thanks.

@zhongvsming
Copy link

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

No branches or pull requests