如何将 .so 文件打包到我的 .aar 存档中? [英] How do I package .so files into my .aar archive?

查看:43
本文介绍了如何将 .so 文件打包到我的 .aar 存档中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以将我的原生 .so 文件打包到我的 .aar 文件中?如果是这样,.so 文件会去哪里,有没有我可以阅读的参考资料?

I was wondering if it's possible to package my native .so files into my .aar file? If so, where would the .so files go and are there any references that I can read in regards to this?

推荐答案

如果手动放的话,应该放在下面

If you put it manually, then it should be placed underneath

jni/<platform>/libexample.so

其中平台是目标 CPU 平台,例如armeabi"、x86"等.通常,您将在那里拥有多个平台的 so 文件.如果你使用 Gradle 从源代码构建,你可以简单地将你的原生源代码放到

where platform is a target CPU platform like "armeabi", "x86" etc. Typically you will have so-files for multiple platforms there. If you build from source code using Gradle you could simply put your native source code to

src/main/jni/

然后构建插件将完成剩下的工作.由于生成的 so-files 将自动构建并放置在它们所属的位置.

and build plugin will do the rest. As the resulting so-files will be built automatically and placed where they belong to.

关于参考资料,我在专门用于 Gradle 的 Android 构建插件的网站上的某处看到了这一点.从那以后,我再也找不到这个页面了.但是您可以查看插件的源代码以获取更多详细信息.

Regarding the references, I've seen this been mentioned somewhere on the site dedicated to Android build plugin for Gradle. Since then I wasn't able to find this page again. But you can check out plugin's source code for more details.

这篇关于如何将 .so 文件打包到我的 .aar 存档中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆