Search code examples
sdkenvironment-variablesbazeltensorflow-lite

bazel cannot find my android sdk path properly


I want to generate tensorflow lite AAR file using bazel command. According to the tensorflow document Android quick start, I install bazel successfully and then, I set ANDROID_SDK_HOME and ANDROID_NDK_HOME in the system enviroment variables as follows :

ANDROID_SDK_HOME = 'G:\IT\AndroidStudioSdk\AndroidStudio'

ANDROID_NDK_HOME = 'G:\IT\AndroidStudioSdk\AndroidStudio\ndk\android-ndk-r17c'

NOTE: I put my android sdk manually in G drive, because I didn't have enough space in C.

And after that, I configure WORKSPACE using configure.cmd file in my tensorflow root directory (C:\Users\username\tensorflow). But, when I want to build TensorFlow Lite AAR with this command :

enter image description here

I face this Error:

enter image description here

Apparently, bazel cannot find path properly.


Solution

  • The NDK, SDK locations should be expressed using the forward slashes / instead of back-slashes \ as the path separator symbol. So, in your case:

    set ANDROID_SDK_HOME = 'G:/IT/AndroidStudioSdk/AndroidStudio'
    set ANDROID_NDK_HOME = 'G:/IT/AndroidStudioSdk/AndroidStudio/ndk/android-ndk-r17c'
    

    And then run the configure.cmd script to use those values when setting up the Android WORKSPACE.