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

Android 7.0 "libjpeg.so" not found #4

Open
gavinYip opened this issue Apr 23, 2018 · 1 comment
Open

Android 7.0 "libjpeg.so" not found #4

gavinYip opened this issue Apr 23, 2018 · 1 comment

Comments

@gavinYip
Copy link

FATAL EXCEPTION: Thread-5
Process: com.blueberry.compress, PID: 14240
java.lang.UnsatisfiedLinkError: dlopen failed: library "libjpeg.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:977)
at java.lang.System.loadLibrary(System.java:1567)
at com.blueberry.compress.ImageCompress.(ImageCompress.java:12)
at com.blueberry.compress.ImageCompress.nativeCompressBitmap(Native Method)
at com.blueberry.compress.MainActivity.compressing(MainActivity.java:145)
at com.blueberry.compress.MainActivity.access$400(MainActivity.java:29)
at com.blueberry.compress.MainActivity$2.run(MainActivity.java:121)

@gavinYip
Copy link
Author

sourceSets {
main {
java.srcDirs 'src/java'
jniLibs.srcDirs '../libjpeg/prebuilt', 'libs'
// jni.srcDirs = ['src/cpp']
// jniLibs.srcDirs '../libjpeg/prebuilt', 'libs'
// 这里没有添加libjpeg.so这个动态库,也是可以执行的。
// 原因在于android本身使用了 libjpeg.so这个动态库,
// 这个库存放在/system/lib下,如果我们没有加入
// libjpeg.so的话,他会去/system/lib下加载这个动态库

        // 如果android手机上没有 libjpeg.so这个动态库的话,
        // 也可以使用: jniLibs.srcDirs '../libjpeg/prebuilt' 'lib'
        // 将libjpeg.so加入到apk中
    }
}

这么配置也没效果

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

1 participant