How to add .so file in Android.mk file?

自古美人都是妖i 提交于 2020-03-05 04:28:37

问题


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

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

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

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

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)**

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

Any leads?


回答1:


LOCAL_PREBUILT_JNI_LIBS = libs/xxxx.so

See example: https://github.com/ayufan-pine64/proprietary_vendor_google_atv/blob/master/atv/Android.mk



来源:https://stackoverflow.com/questions/59452477/how-to-add-so-file-in-android-mk-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!