我尝试使用ndk版本14.1.3816874,Android SDK平台工具版本27.0.1,Android SDK工具26.1.1,SDK Build-Tools 28 rc-1和Bazel在Android Studio 3.1.1中构建tensorflow演示0.11.1-自制
运行终端命令:bazel build thru terminal但是得到了以下错误
$ bazel build //tensorflow/examples/android:tensorflow_demo
我也尝试通过build.gradle运行构建 - bazel但仍然出错。
处理'命令'/ usr / local / bin / bazel''以非零退出值2完成
答案 0 :(得分:0)
看起来Bazel不知道@androidndk
在哪里。
请转到WORKSPACE
个文件和make sure the following lines are not commented out:
# 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
)