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 平台上 NativeLoader 运行异常 #5

Open
Heart-Beats opened this issue Sep 15, 2023 · 5 comments
Open

Android 平台上 NativeLoader 运行异常 #5

Heart-Beats opened this issue Sep 15, 2023 · 5 comments

Comments

@Heart-Beats
Copy link

image

如图,我将 gmssl 的源码以及 gmssl-java 集成在一起编译, 在安卓手机上运行时 NativeLoader.load() 会报错: lib file is not found!, 我改换为安卓上的加载动态库System.loadLibrary("gmssljni"); , 运行没有问题,希望可以兼容处理一下

@wangtsiao
Copy link
Contributor

@Heart-Beats 上一个commit忘记在CMakeLists.txt中添加NativeLoader.java文件了,在CMakeLists.txt文件第41行插入

src/main/java/org/gmssl/NativeLoader.java

改动在这儿,然后重新编译就好了。

@santaan
Copy link

santaan commented Sep 27, 2023

@Heart-Beats 上一个commit忘记在CMakeLists.txt中添加NativeLoader.java文件了,在CMakeLists.txt文件第41行插入

src/main/java/org/gmssl/NativeLoader.java

改动在这儿,然后重新编译就好了。

谢谢,很关键

@Heart-Beats
Copy link
Author

@Heart-Beats 上一个commit忘记在CMakeLists.txt中添加NativeLoader.java文件了,在CMakeLists.txt文件第41行插入

src/main/java/org/gmssl/NativeLoader.java

改动在这儿,然后重新编译就好了。

我这边抽了时间在项目的 CMake 文件中加上了相关的代码:
image

运行还是报一样的错误:
image

这块我是可以理解的,因为 NativeLoader 这个类里的代码在 Android 应用运行时加载的动态库不对:
image
上图是 debug 时 loadLibFile() 方法的入参

@kenansheng
Copy link

@Heart-Beats 能否将您的这个Android工程发给我呢?我的邮箱:13602424424@163.com

@Heart-Beats
Copy link
Author

@Heart-Beats 能否将您的这个Android工程发给我呢?我的邮箱:13602424424@163.com

相关代码我已经上传到这个仓库:GmSSL-Android

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

4 participants