Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

windows - TensorflowLite 1.15.2 aar build failure in Win10:Processing Android resources failed

System information

  • OS Platform and Distribution :win10
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:no
  • TensorFlow installed from (source or binary):source
  • TensorFlow version:1.15.2
  • Python version:3.7.9
  • Installed using virtualenv? pip? conda?: no,using bazel and the default python in system
  • Bazel version (if compiling from source):0.26.1
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: no
  • GPU model and memory:no

Describe the problem

I was trying to build the tensorflow-lite-1.15.2.aar from source on my local WIN10 PC, I downloaded the source code and installed bazel following instructions online. The version of ANDROID_NDK is 18.1.5063045 and ANDOIRD_SDK is 23 After configuring the bazelrc, I executed the build command and got the following error:

[18 / 56] Processing Android resources for //tensorflow/lite/java:tensorflow-lite_dummy_app_for_so; 1s local ... (12 actions, 11 running)
ERROR: D:/code/tensorflow-1.15.2/tensorflow-1.15.2/tensorflow/lite/java/BUILD:22:1: Processing Android resources for //tensorflow/lite/java:tensorflow-lite_dummy_app_for_so failed (Exit 1): ResourceProcessorBusyBox.exe failed: error executing command
  cd C:/users/c00/_bazel_c00/7oqu2vjd/execroot/org_tensorflow
  SET ANDROID_BUILD_TOOLS_VERSION=30.0.0
    SET ANDROID_NDK_API_LEVEL=18
    SET ANDROID_NDK_HOME=D:/softwares/AndroidSDK/ndk/18.1.5063045
    SET ANDROID_SDK_API_LEVEL=23
    SET ANDROID_SDK_HOME=D:/softwares/AndroidSDK
    SET PATH=C:Program FilesGitusrin;C:Program FilesGitin;C:WINDOWS;C:WINDOWSSystem32;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Usersc00in;C:Program FilesGitmingw64in;C:Program FilesGitusrlocalin;C:Program FilesGitusrin;C:Program FilesGitusrin;C:Program FilesGitmingw64in;C:Program FilesGitusrin;C:Usersc00in;%PyCharm%;%GoLand%;%IntelliJ IDEA%;C:WINDOWSsystem32configsystemprofilegoin;C:Program FilesPython37;C:Program FilesPython37Scripts;D:softwaresapache-maven-3.6.3in;D:softwaresAndroidSDKplatform-toolsadb.exe;C:Program Files (x86)GnuWin32in;C:WindowsSystem32;C:Program FilesGitusringit.exe;C:Program FilesGit LFS;C:Program FilesJavajdk1.8.0_202in;C:Program FilesJavajdk1.8.0_202jrein;D:softwaresPyCharm 2020.1in;D:softwaresGoLand 2020.1.3in;D:softwaresIntelliJ IDEA 2020.2in;C:Usersc00goin;C:Program FilesGitusrinvendor_perl;C:Program FilesGitusrincore_perl
    SET PYTHON_BIN_PATH=C:/Program Files/Python37/python.exe
    SET PYTHON_LIB_PATH=C:/Program Files/Python37/lib/site-packages
    SET RUNFILES_MANIFEST_ONLY=1
    SET TF2_BEHAVIOR=0
    SET TF_CONFIGURE_IOS=0
    SET TF_ENABLE_XLA=1
  bazel-out/x64_windows-opt/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/ResourceProcessorBusyBox.exe @bazel-out/x64_windows-opt/bin/tensorflow/lite/java/tensorflow-lite_dummy_app_for_so_symbols/R.txt-0.params
Execution platform: @bazel_tools//platforms:host_platform
一月 22, 2021 5:18:13 下午 com.google.devtools.build.android.ResourceProcessorBusyBox processRequest
严重: Error during processing
java.nio.file.InvalidPathException: Illegal character [:] in path at index 4: ///C:/Users/C00520~1/AppData/Local/Temp/android_resources_tmp5724987117968661034/linked/bin.-pb.apk
        at sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:111)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at com.google.devtools.build.android.aapt2.ProtoApk.asApkPath(ProtoApk.java:203)
        at com.google.devtools.build.android.aapt2.ResourceLinker.link(ResourceLinker.java:555)
        at com.google.devtools.build.android.aapt2.ResourceLinker.link(ResourceLinker.java:536)
        at com.google.devtools.build.android.Aapt2ResourcePackagingAction.main(Aapt2ResourcePackagingAction.java:185)
        at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$14.call(ResourceProcessorBusyBox.java:144)
        at com.google.devtools.build.android.ResourceProcessorBusyBox.processRequest(ResourceProcessorBusyBox.java:240)
        at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:203)

Exception in thread "main" java.nio.file.InvalidPathException: Illegal character [:] in path at index 4: ///C:/Users/C00520~1/AppData/Local/Temp/android_resources_tmp5724987117968661034/linked/bin.-pb.apk
        at sun.nio.fs.WindowsPathParser.nextSlash(WindowsPathParser.java:212)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:111)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at java.nio.file.Paths.get(Paths.java:84)
        at com.google.devtools.build.android.aapt2.ProtoApk.asApkPath(ProtoApk.java:203)
        at com.google.devtools.build.android.aapt2.ResourceLinker.link(ResourceLinker.java:555)
        at com.google.devtools.build.android.aapt2.ResourceLinker.link(ResourceLinker.java:536)
        at com.google.devtools.build.android.Aapt2ResourcePackagingAction.main(Aapt2ResourcePackagingAction.java:185)
        at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$14.call(ResourceProcessorBusyBox.java:144)
        at com.google.devtools.build.android.ResourceProcessorBusyBox.processRequest(ResourceProcessorBusyBox.java:240)
        at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:203)
Target //tensorflow/lite/java:tensorflow-lite failed to build
INFO: Elapsed time: 2.462s, Critical Path: 1.37s
INFO: 14 processes: 14 local.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

Provide the exact sequence of commands / steps that you executed before running into the problem

_bazel build --cxxopt='--std=c++11' -c opt --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a //tensorflow/lite/java:tensorflow-lite

Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Here is the tf_configure.bazelrc content I got ,

  • I have JDK1.8 installed before ,so I added the "java_toolchain" setting
  • I used the ./configure to interactively configure it,but I couldn't get these "action_env" adout android, so I add those action_env manually.
  • I tried to remove some of the "build:opt" ,it didn't work,cause I don't really understand all of them
  • I tried to change the SDK and NDK higher ,to like 29/30, it didn't solve the problem either.
build --action_env PYTHON_BIN_PATH="C:/Program Files/Python37/python.exe"
build --action_env PYTHON_LIB_PATH="C:/Program Files/Python37/lib/site-packages"
build --python_path="C:/Program Files/Python37/python.exe"
build:xla --define with_xla_support=true
build --config=xla
build:opt --copt=-march=native
build:opt --copt=-Wno-sign-compare
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
build --config monolithic
build --copt=-w --host_copt=-w
build --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI
build --verbose_failures
build --distinct_host_configuration=false
build --define=override_eigen_strong_inline=true
build:v2 --define=tf_api_version=2
build --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
build --action_env ANDROID_NDK_HOME="D:/softwares/AndroidSDK/ndk/18.1.5063045"
build --action_env ANDROID_NDK_API_LEVEL="18"
build --action_env ANDROID_BUILD_TOOLS_VERSION="30.0.0"
build --action_env ANDROID_SDK_API_LEVEL="23"
build --action_env ANDROID_SDK_HOME="D:/softwares/AndroidSDK"
test --flaky_test_attempts=3
test --test_size_filters=small,medium
test --test_tag_filters=-benchmark-test,-no_oss,-oss_serial
test --build_tag_filters=-benchmark-test,-no_oss
test --test_tag_filters=-no_windows,-gpu
test --build_tag_filters=-no_windows,-gpu
build --action_env TF_CONFIGURE_IOS="0"

I have opened an issue on github ,but I haven't get reply for two days so I'm posting the question here again,relly looking forwarding to useful advice, Thanks.

question from:https://stackoverflow.com/questions/65880875/tensorflowlite-1-15-2-aar-build-failure-in-win10processing-android-resources-fa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...