1

尝试将我的 android 应用程序调试为 Native 时出现以下错误。我在 Windows 上运行。我选择 Debug As->Android Native Application

“找不到平台文件(头文件和库)请运行 build/tools/build-platforms.sh 构建相应目录。”

是:我的 NDK 路径是在 Eclipse->Preferences 中设置的。

是:NDK 和 SDK 路径是在 PATH 环境变量中设置的。

在网上搜索解决方案后,我遇到了导致错误的 init.mk 文件,但我无法设计解决方案。build-platforms.sh 不存在。看起来可能 NDK_ROOT 没有被调用构建过程的任何东西设置?

The platform files were moved in the Android source tree from
$TOP/ndk/build/platforms to $TOP/development/ndk/platforms. However,
the official NDK release packages still place them under the old
location for now, so deal with this here
NDK_PLATFORMS_ROOT := $(strip $(NDK_PLATFORMS_ROOT))

    ifndef NDK_PLATFORMS_ROOT
    NDK_PLATFORMS_ROOT := $(strip $(wildcard $(NDK_ROOT)/platforms))
    ifndef NDK_PLATFORMS_ROOT
    NDK_PLATFORMS_ROOT := $(strip $(wildcard $(NDK_ROOT)/build/platforms))
    endif

    ifndef NDK_PLATFORMS_ROOT
    $(call __ndk_info,Could not find platform files (headers and libraries))
    $(if $(strip $(wildcard $(NDK_ROOT)/RELEASE.TXT)),\
        $(call __ndk_info,Please define NDK_PLATFORMS_ROOT to point to a valid directory.)\
    ,\
        $(call __ndk_info,Please run build/tools/build-platforms.sh to build the corresponding directory.)\
    )
    $(call __ndk_error,Aborting)
    endif

    $(call ndk_log,Found platform root directory: $(NDK_PLATFORMS_ROOT))
endif
4

0 回答 0