如何在Android.mk文件中添加.so文件? [英] How to add .so file in Android.mk file?

查看:1763
本文介绍了如何在Android.mk文件中添加.so文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将.aar文件作为依赖项导入到我的android项目中,并将其添加到Android.mk文件中。

I am importing a .aar file as a dependency in my android project and have added this to Android.mk file.

现在,此文件在内部具有对某些 .so 文件的依赖,这些文件无法自动提取。

Now internally this file has dependency on some .so files which its not able to pick up automatically.

所以我在以下结构下复制了所有相关的 .so 文件

So I copied all the dependent .so files under the below structure,

     app --> libs --> arm64-v8a --> test.so 
              |
              |   --> x86 --> test.so 

现在我尝试在Android.mk文件中配置以下几种组合,但是上面test.so文件未添加到构建后生成的apk中。

And now I tried several combination of below config in Android.mk file, but the above test.so file is not getting added to the apk generated after building.




. . . .

    **include $(CLEAR_VARS)

    ifneq (,$(filter $(TARGET_ARCH_ABI), armeabi-v7a x86 arm64-v8a x86_64))
    LOCAL_MODULE := Some Name
    LOCAL_SRC_FILES := sources/app/libs/$(TARGET_ARCH)/xyz.so  //Path of of my local .so file
    LOCAL_MODULE_CLASS := SHARED_LIBRARIES
    include $(PREBUILT_SHARED_LIBRARY)**

我尝试了很多谷歌搜索,也提到了Android Xref,但无法弄清我所缺少的东西。

I tried lot of googling and also referred Android Xref, but unable to figure out what I am missing.

任何线索?

推荐答案

LOCAL_PREBUILT_JNI_LIBS = libs / xxxx.so

LOCAL_PREBUILT_JNI_LIBS = libs/xxxx.so

请参见示例:
https://github.com/ayufan- pine64 / proprietary_vendor_google_atv / blob / master / atv / Android.mk

这篇关于如何在Android.mk文件中添加.so文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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