Android studio 失败:生成未成功完成

Android studio 失败:生成未成功完成,android-studio,tensorflow,android-ndk,bazel,Android Studio,Tensorflow,Android Ndk,Bazel,我尝试在Android Studio 3.1.1中使用ndk版本14.1.3816874、Android SDK平台工具版本27.0.1、Android SDK工具26.1.1、SDK构建工具28 rc-1和Bazel 0.11.1-homebrew构建tensorflow演示 运行terminal命令:bazel build thru terminal,但出现以下错误 $ bazel build //tensorflow/examples/android:tensorflow_demo 我

我尝试在Android Studio 3.1.1中使用ndk版本14.1.3816874、Android SDK平台工具版本27.0.1、Android SDK工具26.1.1、SDK构建工具28 rc-1和Bazel 0.11.1-homebrew构建tensorflow演示

运行terminal命令:bazel build thru terminal,但出现以下错误

$ bazel build //tensorflow/examples/android:tensorflow_demo

我还试图通过build.gradle-bazel运行build,但仍然出错

进程“command”/usr/local/bin/bazel“”以非零退出值2结束


看起来Bazel不知道androidndk在哪里

请转到
工作区
文件并:

#取消注释并更新这些条目中的路径以构建Android演示。
android_sdk_存储库(
name=“androidsdk”,
api_等级=23,
#请确保已在中安装以下生成工具版本
#SDK管理器,因为它会定期更新。
构建工具版本=“26.0.1”,
#替换为系统上Android SDK的路径
路径=”,
)
android\u ndk\u存储库(
name=“androidndk”,
路径=”,
#编译TensorFlow需要14或更高。
#请将API级别指定为>=21以生成64位
#架构或安卓NDK将自动选择最大的
#它支持的API级别,恕不另行通知。
#请注意,NDK版本不是API级别。
空气污染指数=14
)
# Uncomment and update the paths in these entries to build the Android demo.
android_sdk_repository(
    name = "androidsdk",
    api_level = 23,
    # Ensure that you have the build_tools_version below installed in the
    # SDK manager as it updates periodically.
    build_tools_version = "26.0.1",
    # Replace with path to Android SDK on your system
    path = "<PATH_TO_SDK>",
)

android_ndk_repository(
    name="androidndk",
    path="<PATH_TO_NDK>",
    # This needs to be 14 or higher to compile TensorFlow.
    # Please specify API level to >= 21 to build for 64-bit
    # archtectures or the Android NDK will automatically select biggest
    # API level that it supports without notice.
    # Note that the NDK version is not the API level.
    api_level=14
)