I am trying to use ndk-build
to use native code for audio processing from Little Endian in an Android application (I don't have JNI yet).
When I executed ndk-build in jni dir I got ($USER_PATH is path to directory on my computer):
Android NDK: WARNING: Rebuilding libc++ libraries from sources! Android NDK: You might want to use $NDK/build/tools/build-cxx-stl.sh --stl=libc++ Android NDK: in order to build prebuilt versions to speed up your builds! Android NDK: ERROR:$USER_PATH/android-ndk-r10/sources/android/compiler-rt/Android.mk:compiler_rt_shared: LOCAL_SRC_FILES points to a missing file Android NDK: $USER_PATH/Android/android-ndk-r10/sources/android/compiler-rt/libs/armeabi/libcompiler_rt_shared.so exists or that its path is correct $USER_PATH/android-ndk-r10/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
I saw that is because of PREBUILT_STATIC_LIBRARY which points to missing files.
How can I solve this?
Directory structure:
There are .mk files:
MY_LOCAL_PATH := $(call my-dir) ifndef LE_SDK_PATH LE_SDK_PATH := $(call my-dir) endif include $(MY_LOCAL_PATH)/le_audioio.mk include $(MY_LOCAL_PATH)/le_utility.mk LOCAL_PATH := ${MY_LOCAL_PATH} include $(CLEAR_VARS) LOCAL_MODULE := little-endian LOCAL_STATIC_LIBRARIES := le_audioio le_utility include $(BUILD_SHARED_LIBRARY)
APP_PLATFORM := android-14 APP_STL := c++_static APP_ABI := armeabi armeabi-v7a x86 APP_OPTIM := release APP_CFLAGS += -g NDK_TOOLCHAIN_VERSION := clang
ifndef LE_SDK_PATH LE_SDK_PATH := $(call my-dir) endif LOCAL_PATH:= $(LE_SDK_PATH) include $(CLEAR_VARS) LOCAL_MODULE := le_audioio LOCAL_EXPORT_C_INCLUDES := $(abspath $(LE_SDK_PATH)/include) LOCAL_EXPORT_LDLIBS += -lOpenSLES ifeq ($(TARGET_ARCH_ABI),x86) LOCAL_SRC_FILES := libs/development/libAudioIO_Android_x86-32_SSSE3.a else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_ARM_NEON := true LOCAL_SRC_FILES := libs/development/libAudioIO_Android_ARMv7a_NEON.a else LOCAL_SRC_FILES := libs/release/libAudioIO_Android_ARMv6_VFP2.a endif endif include $(PREBUILT_STATIC_LIBRARY)
ifndef LE_SDK_PATH LE_SDK_PATH := $(call my-dir) endif LOCAL_PATH:= $(LE_SDK_PATH) include $(CLEAR_VARS) LOCAL_MODULE := le_utility LOCAL_EXPORT_C_INCLUDES := $(abspath $(LE_SDK_PATH)/include) LOCAL_EXPORT_LDLIBS += -landroid -llog ifeq ($(TARGET_ARCH_ABI),x86) LOCAL_SRC_FILES := libs/development/libUtility_Android_x86-32_SSSE3.a else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_ARM_NEON := true LOCAL_SRC_FILES := libs/development/libUtility_Android_ARMv7a_NEON.a else LOCAL_SRC_FILES := libs/release/libUtility_Android_ARMv6_VFP2.a LOCAL_EXPORT_LDLIBS += -latomic endif endif include $(PREBUILT_STATIC_LIBRARY)
There is more specific documentation for the Android.mk and Application.mk configuration used by ndk-build. Running the ndk-build script is equivalent to running the following command: $GNUMAKE points to GNU Make 3.81 or later, and <ndk> points to your NDK installation directory.
You need GNU Make 4 to use ndk-build or the NDK in general. The NDK includes its own copy of GNU Make and will use that unless you've set the $GNUMAKE environment variable to point to an unsuitable make. In NDK r18 and newer, ndk-build can generate a JSON compilation database.
ndk-build NDK_APP_APPLICATION_MK=<file> --> rebuild, using a specific Application.mk pointed to by the NDK_APP_APPLICATION_MK command-line variable. which suggests that it is still looking for the original Application.mk file.
The rest of the section describes the two libraries that are available for writing high-performance audio applications: OpenSL ES is an Android-specific implementation of the OpenSL ES™ API specification from the Khronos Group. OpenSL ES is not recommended for new designs.
Try this a new solution by Google for audio application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With