android aar找不到so,Import Android AAR with JNI so files

在尝试将包含x86目录下.so文件的AAR模块导入为'my-java-module'时,遇到Java Native Library加载失败的问题。错误提示找不到'libjavamodule.so'。通过更改变模块名为'javamodule',库加载成功,但出现无实现错误。问题在于如何指示Android从AAR模块加载x86架构的.so文件以找到正确实现。
摘要由CSDN通过智能技术生成

Trying to import AAR as module 'my-java-module' which contains a /jni/x86 folder with two .so files. When using the classes from the module, I was getting error saying:

W/System.err: Native code library (javamodule) failed to load.

W/System.err: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.things.jar", zip file "/data/app/com.test.app-a3ZcweiV8k7NhpzM3KSjc==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.app-a3ZcweiV8k7NhpzM3KSjc==/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libjavamodule.so"

So I change module name to 'javamodule' and it loads but now gives no implementation error:

E/zygote: No implementation found for void module_function()

Question: How do I tell Android to load the /lib/x86 .so files from the AAR module that was imported so that it finds the implementation?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值