Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
331 views
in Technique[技术] by (71.8m points)

android - UnsatisfiedLinkError: dalvik.system.PathClassLoader

I'm making an application for AndroidTV and get the error

java.lang.UnsatisfiedLinkError:
 dalvik.system.PathClassLoader[DexPathList[[zip file
 "/data/app/mytv.mytv-2/base.apk"

on a NexusPlayer with Android 6.0.1. Curious that it works on a smart TV with Android 5.1.1.

The whole text error is:

java.lang.UnsatisfiedLinkError:
 dalvik.system.PathClassLoader[DexPathList[[zip file
 "/data/app/mytv.mytv-2/base.apk"],nativeLibraryDirectories=[/data/app/mytv.mytv-2/lib/x86, /data/app/mytv.mytv-2/base.apk!/lib/x86, /vendor/lib, /system/lib]]]
 couldn't find "libnmpsdk.so"

if helps.

(jniLabs is fine with 2 folders armeabi and armeabi-v7a and each one has libnmpsdk.so)

The error line that log is showing me has this part of code:

static {
    System.loadLibrary("nmpsdk");
}

If anyone had encountered this problem please let me know, i haven't found anything that solves it yet.

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So this is the solution for UnsatisfiedLinkError for my case but I think it's general.

Put in gradle.properties this line

android.useDeprecatedNdk=true;

and in build.gradle this line in defaultConfig field

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...