android - NDK 无法在 NDK_MODULE_PATH 中找到我的模块 - android-ndk-profiler

标签 android c++ android-ndk profiling profiler

我正在尝试使用 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/

相关文章:

android - 窗口在显示进度对话框时在异步任务中泄漏

带有 VectorDrawables srcCompat 的 Android Selector Drawable

c++ - MFC Rich编辑控件2.0文本颜色

android - android-ndk makefile 中的常见预定义变量是什么,我如何查看这些变量?

android-studio - 为什么我会收到此 Android Studio 错误 : "recompile with -fPIC"?

android - Android 3.1 上的 GCM 推送通知 : disable broadcast receiver

Android:如何让 ImageView 填满屏幕

c++ - 在派生类中使用基类 typedef

c++ - 未调用 QCoreApplication 析构函数

java - Gradle同步失败: Build tools download failed with code 2