<p dir="auto">I installed CPU-only Tensorflow version 1.0 on Windows using the pip installer. I am trying to get the Android example to run using CMake as explained in <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android/cmake">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android/cmake</a>. I cloned the newest version of the tensorflow repository and created a new Android studio project and followed the instructions from the webpage above by modifying the gradle files.  I already found out that it should be<br>
<code class="notranslate">debugCompile project(path: ':TensorFlow-Android-Inference', configuration: 'debug') releaseCompile project(path: ':TensorFlow-Android-Inference', configuration: 'release')</code><br>
instead of<br>
<code class="notranslate">debugCompile project(path: ':tensorflow_inference', configuration: 'debug') releaseCompile project(path: ':tensorflow_inference', configuration: 'release')</code><br>
Now, however, I get a build error stating "Error:Project :app declares a dependency from configuration 'releaseCompile' to configuration 'release' which is not declared in the descriptor for project :TensorFlow-Android-Inference."<br>
Has anyone tried this or could anyone point me to a proper explanation of how to use cMake to build the project.<br>
Any help would be very much appreciated. Thanks.</p>
<h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="193635283" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/6101" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/6101/hovercard" href="https://github.com/tensorflow/tensorflow/issues/6101">#6101</a><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="196269350" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/6383" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/6383/hovercard" href="https://github.com/tensorflow/tensorflow/issues/6383">#6383</a><br>
<a href="http://stackoverflow.com/questions/40978859/creating-simple-android-app-using-android-studio-and-tensorflow" rel="nofollow">http://stackoverflow.com/questions/40978859/creating-simple-android-app-using-android-studio-and-tensorflow</a></p>
<h3 dir="auto">Environment info</h3>
<p dir="auto">Operating System: Windows</p>
<p dir="auto">Installed version of CUDA and cuDNN:<br>
(please attach the output of <code class="notranslate">ls -l /path/to/cuda/lib/libcud*</code>):<br>
Cuda 8.0<br>
cuDNN 5.0</p>
<p dir="auto">If installed from source, provide</p>
<ol dir="auto">
<li>
<p dir="auto">The commit hash (<code class="notranslate">git rev-parse HEAD</code>)<br>
I downloaded the latest ZIP on 18 Dec 2016. Sorry, I have no idea how to get the version.</p>
</li>
<li>
<p dir="auto">The output of <code class="notranslate">bazel version</code><br>
Build label: 0.4.2<br>
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar<br>
Build time: Wed Dec 7 18:47:13 2016 (1481136433)<br>
Build timestamp: 1481136433<br>
Build timestamp as int: 1481136433</p>
</li>
</ol>
<p dir="auto">My goal is to build an Android App which loads pre-trained TensorFlow model and runs it on an Android device. I am working on Android Studio on Windows. Unfortunately using Android Studio on Linux is currently not an option.</p>
<p dir="auto">Following previous advice from this forum, I am trying to build an Android example using Bazel on Windows.<br>
I've successfully installed Bazel using Chocolatey.<br>
Following the build instructions, I changed the SDK and NDK paths in WORKSPACE file and ran:<br>
<strong>bazel build //tensorflow/examples/android:tensorflow_demo</strong></p>
<p dir="auto">So far I did the following to fix errors:</p>
<ol dir="auto">
<li>copied aapt.exe to aapt, zipalign.exe to zipalign, since their name is different on Windows/Linux</li>
<li>installed using pacman gcc</li>
</ol>
<p dir="auto">But I am stuck again. I am getting the following error which I have no idea how to fix:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: C++ compilation of rule '@protobuf//:protobuf_lite' failed: arm-linux-androideabi-gcc failed: error executing command external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc -fstack-protector-strong -fpic -ffunction-sections -funwind-tables ... (remaining 44 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/protobuf/src/google/protobuf/stubs/structurally_valid.cc:588:1: fatal error: opening dependency file bazel-out/android-arm-linux-androideabi-4.9-v7a-gnu-libstdcpp-fastbuild/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/structurally_valid.d: No such file or directory
 }  // namespace google
 ^
compilation terminated.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_symbols/R.txt' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo.srcjar' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/proguard/tensorflow_demo/_tensorflow_demo_proguard.cfg' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_processed_manifest/AndroidManifest.xml' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_files/resource_files.zip' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo.ap_' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/stringprintf.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/arenastring.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:113:1: output 'external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/io/strtod.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/repeated_field.o' was not created.
Target //tensorflow/examples/android:tensorflow_demo failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.722s, Critical Path: 1.16s
"><pre class="notranslate"><code class="notranslate">ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: C++ compilation of rule '@protobuf//:protobuf_lite' failed: arm-linux-androideabi-gcc failed: error executing command external/androidndk/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc -fstack-protector-strong -fpic -ffunction-sections -funwind-tables ... (remaining 44 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/protobuf/src/google/protobuf/stubs/structurally_valid.cc:588:1: fatal error: opening dependency file bazel-out/android-arm-linux-androideabi-4.9-v7a-gnu-libstdcpp-fastbuild/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/structurally_valid.d: No such file or directory
 }  // namespace google
 ^
compilation terminated.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_symbols/R.txt' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo.srcjar' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/proguard/tensorflow_demo/_tensorflow_demo_proguard.cfg' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_processed_manifest/AndroidManifest.xml' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo_files/resource_files.zip' was not created.
ERROR: C:/Tools/tensorflow-master/tensorflow/examples/android/BUILD:58:1: output 'tensorflow/examples/android/tensorflow_demo.ap_' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/stringprintf.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/arenastring.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:113:1: output 'external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/io/strtod.o' was not created.
ERROR: C:/Users/Andrey/AppData/Local/Temp/_bazel_Andrey/gd3-gSwg/external/protobuf/BUILD:73:1: output 'external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/repeated_field.o' was not created.
Target //tensorflow/examples/android:tensorflow_demo failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.722s, Critical Path: 1.16s

</code></pre></div>
<ol dir="auto">
<li>Please advice how to proceed?</li>
<li>Isn't there an easier way to achieve what I want? I just need pre-built TensorFlow binaries for Android Studio on Windows, to build an example application.  So far I found only pre-built Python distribution and Bazel installation on Windows</li>
</ol>