android - 在导入路径中找不到带有标签的模块 (Android NDK)

标签 android android-ndk android.mk import-module

我对这个问题感到非常沮丧。我一直得到它,我不知道为什么。这是我在 src/jni 中的 Android.mk

LOCAL_PATH := $(call my-dir) 
include $(CLEAR_VARS)
LOCAL_MODULE    := tutorial01
LOCAL_SRC_FILES := tutorial01.c
LOCAL_LDLIBS := -llog -lz
LOCAL_SHARED_LIBRARIES := libavformat_static libavcodec_static libavutil_static 
include $(BUILD_SHARED_LIBRARY)
$(call import-module,ffmpeg-2.4.2/android/armv7-a)

这是我的/jni/ffmpeg-2.4.2/android/armv7-a 中的 Android.mk

LOCAL_PATH:= $(call my-dir)
#static version of libavcodec
include $(CLEAR_VARS)
LOCAL_MODULE:= libavcodec
LOCAL_SRC_FILES:= lib/libavcodec.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libavformat
include $(CLEAR_VARS)
LOCAL_MODULE:= libavformat
LOCAL_SRC_FILES:= lib/libavformat.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libswscale
include $(CLEAR_VARS)
LOCAL_MODULE:= libswscale
LOCAL_SRC_FILES:= lib/libswscale.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
#static version of libavutil
include $(CLEAR_VARS)
LOCAL_MODULE:= libavutil
LOCAL_SRC_FILES:= lib/libavutil.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_STATIC_LIBRARY)
![enter image description here][1]

我在通过 eclipse 构建(ndk-build)或清理项目时不断遇到这个问题

**** Clean-only build of configuration Default for project android-ffmpeg-tutorial01 ****

/Applications/adt-bundle-mac-x86_64-20130514/android-ndk-r10c/ndk-build clean 
Android NDK: jni/Android.mk: Cannot find module with tag 'ffmpeg-2.4.2/android/armv7-a' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
jni/Android.mk:11: *** Android NDK: Aborting.    .  Stop.
Android NDK: The following directories were searched:    
Android NDK:         

**** Build Finished ****

请帮忙:(

最佳答案

使用import-module您将需要设置/导出环境变量 NDK_MODULE_PATH指向导入模块的父文件夹路径。

    $(call import-module,ffmpeg-2.4.2/android/armv7-a)

所以对于 <parent-path>/ffmpeg-2.4.2/android/armv7-a , 设置/导出 NDK_MODULE_PATH = parent-path

另一种选择是显式添加路径,在 call import-module 之前添加下行,例如:

    $(call import-add-path, parent-path)
    $(call import-module,ffmpeg-2.4.2/android/armv7-a)

参见 this for other examples

关于android - 在导入路径中找不到带有标签的模块 (Android NDK),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26662264/

相关文章:

android - 无法打开 https 流 - 找不到协议(protocol)(带有 openssl 的 ffmpeg)

android - 将自定义 etc 文件添加到 aosp build

android - Android Chrome 上的网络音频 API

android - 在 Android 中需要列表的地方使用 Kotlin Mutable List 或 ArrayList

java - Android 中如何获取最后插入的记录?

java - 安卓 : Need to create Shared Preferences object in c++ NDK and Store some Boolean value

c++ - 在 Android NDK 上检测 stdint.h 和 C++11

android - android构建系统中不再有Android.mk吗?

Android NDK - 附加包含目录

java - 在 Android 中登录文本文件