How to include architecture folders \[arm64-v8a , armeabi , armeabi-v7a , x86 and x86\_64\

Issue

How to include arm64-v8a , armeabi , armeabi-v7a , x86 and x86_64 files in Local_LDLIBS ?

I have .a files in this 5 folders [arm64-v8a , armeabi , armeabi-v7a , x86 and x86_64].

In my lib folder.

enter image description here

When I include it in my Android.mk it comes like this.

 clang++: error: no such file or directory: 'jni/../lib/libavformat.a'

My Android.mk file

include $(CLEAR_VARS)
LOCAL_PATH : $(WORKING_DIR)
LOCAL_MODULE    : a
LOCAL_CFLAGS : -DHAVE_AV_CONFIG_H -stdc99 -D__STDC_CONSTANT_MACROS -DSTDC_HEADERS -Wno-deprecated-declarations
LOCAL_SRC_FILES : a.c
LOCAL_LDLIBS : -llog -lm -lz $(WORKING_DIR)/../lib/libavformat.a 
include $(BUILD_SHARED_LIBRARY)

How can I solve this ?

How can I add all architecture files in LOCAL_LDLIBS?

Solution

You need to declare them as prebuilt targets in your Android.mk. See https://developer.android.com/ndk/guides/prebuilts for how to do this.

Answered By – Dan Albert

Leave a Comment