我正在尝试使用 android-ndk-profiler - https://github.com/richq/android-ndk-profiler
如使用文档中所述https://github.com/richq/android-ndk-profiler/blob/master/docs/Usage.md
我把zip文件解压到$HOME/Documents/Dev
我的 Android.mk 看起来像这样
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ndkbasics
LOCAL_SRC_FILES := ndkbasics.cpp
LOCAL_LDLIBS := -llog
# compile with profiling
LOCAL_CFLAGS := -pg
LOCAL_STATIC_LIBRARIES := android-ndk-profiler
include $(BUILD_SHARED_LIBRARY)
# at the end of Android.mk
$(call import-module,android-ndk-profiler)
尝试使用命令构建时
ndk-build NDK_MODULE_PATH=$HOME/Documents/Dev/
我得到了错误
Android NDK: /Users/hanantha/Documents/Dev/projects/workspaceWeeklyPreso/NdkProfileMethods/jni/Android.mk: Cannot find module with tag 'android-ndk-profiler' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
/Users/hanantha/Documents/Dev/projects/workspaceWeeklyPreso/NdkProfileMethods/jni/Android.mk:16: *** Android NDK: Aborting. . Stop.
补充点
- 我已经尝试在我的 bash_profile 中设置 NDK_MODULE_PATH
- ndk 版本 r10d
- 运行解压文件夹android-ndk-profiler中的make文件
ndk 说它搜索的目录是空的,这很奇怪。可能出了什么问题?
最佳答案
我认为你已经完成了几乎正确的过程,需要在一个地方改变如下
# at the end of Android.mk
$(call import-module,android-ndk-profiler/jni)
在导入模块中添加 jni
将解决您的问题,因为它对我有用。
关于android - NDK 无法在 NDK_MODULE_PATH 中找到我的模块 - android-ndk-profiler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29980046/