Unable to build Android Example App using Bazel on Windows

What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?
https://github.com/tensorflow/tensorflow/issues/6101
https://github.com/tensorflow/tensorflow/issues/6383
http://stackoverflow.com/questions/40978859/creating-simple-android-app-using-android-studio-and-tensorflow
Environment info
Operating System: Windows
Installed version of CUDA and cuDNN:
(please attach the output of ls -l /path/to/cuda/lib/libcud*):
Cuda 8.0
cuDNN 5.0
If installed from source, provide

The commit hash (git rev-parse HEAD)
I downloaded the latest ZIP on 18 Dec 2016. Sorry, I have no idea how to get the version.

The output of bazel version
Build label: 0.4.2
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Dec 7 18:47:13 2016<PHONE_NUMBER>)
Build timestamp:<PHONE_NUMBER>
Build timestamp as int:<PHONE_NUMBER>

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.
Following previous advice from this forum, I am trying to build an Android example using Bazel on Windows.
I've successfully installed Bazel using Chocolatey.
Following the build instructions, I changed the SDK and NDK paths in WORKSPACE file and ran:
bazel build //tensorflow/examples/android:tensorflow_demo
So far I did the following to fix errors:

copied aapt.exe to aapt, zipalign.exe to zipalign, since their name is different on Windows/Linux
installed using pacman gcc

But I am stuck again. I am getting the following error which I have no idea how to fix:
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

Please advice how to proceed?
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

@petewarden, you mentioned you have had experience with android builds on windows.

Ok, after trying to build the Bazel example Android project on Linux, and reverse engineering the .apk package, it looks like it depends only on a single .so native TensorFlow Android library, called libtensorflow_demo.so.
Currently in order to build this simple example on Windows, I needed to:

Install chocolatey
Install bazel
Install pacman
Download gcc using pacman
Change some sdk .exe files to no extenstion, to fit Linux
And it still does not work 👎

I think that it could really help if there was an example Android Studio project for windows which does not use Bazel at all.  Instead let's put the mentioned above pre-compiled TensorFlow library available for download (for all possible Android architectures) ,together with a simple tutorial.

Unfortunately Bazel doesn't support Android on Windows yet.
However we do have cmake support in tensorflow/contrib/android/cmake that should let you build the library necessary for simple Android inference on Windows (this excludes some native code created specifically for the demo). Full demo support should be coming soon, possibly including pre-built libs.
As a sort-of-hacky alternative you can grab the APK built by Jenkins here, and unzip it to grab libtensorflow_demo.so to manually place into your project.

@AndreyRub Please see http://ci.tensorflow.org/view/Nightly/job/nightly-android/ for a full selection of prebuilt Android TF libs, which has just come online.
You can either download libtensorflow_inference.so for something that can be dropped into a standalone app, or grab
libtensorflow_demo.so if you're trying to get the TF Android demo to run (contains libtensorflow_inference.so + demo-specific native code).
In either case you will need libandroid_tensorflow_inference_java.jar as well for the Java counterpart.

@andrewharp or @AndreyRub Could you please provide some steps for such goal:
In order to build simple example on Windows with retrained model, I needed to:

Install chocolatey
Install bazel
....

I am really stuck with it. Thank you.

@bulatyauheni Bazel does not support Android on Windows yet. You might try the cmake build, but easiest thing to do if you just want to plug something into your Android Studio project is to grab the pre-built libraries referenced above.

@andrewharp  Hey Andrew I am trying to build tensorflow/examples/android on windows 7 using Android Studio. Is it possible or not ?

@Anmolk22 I'll try to help you. Bazel does not work properly on Windows, so for building project you should use prebuilded libs.

(Open this link and download last stable build archive http://ci.tensorflow.org/view/Nightly/job/nightly-android/) It should contains following files

Remove buildNative and copyNativeLibs tasks from build.gradle file.
Copy libs from archive to libs derectory of android project.

The native libs necessary for the demo can now be built with make, completely removing the need for Bazel on Linux and OS X system. Set buildWithMake to true in build.gradle to try.
However, it seems some extra changes will still be required to get this to get the make builds to work on Windows, so reopening to track.

Ok, I've got something sort of working. It needs some more tweaking, and I would recommend sticking with the prebuilts as described by @bulatyauheni above, but if you're feeling adventurous here's how you can build the Android TF libraries on Windows 10.
First, install Bash for Windows as described here: https://msdn.microsoft.com/en-us/commandline/wsl/about
Once that's done, start bash and run the following, adjusting directories appropriately:
# Install necessary components
sudo apt-get install make unzip autoconf ccache autogen libtool g++ zlibc-dev

# Download and install the NDK (has to be the Linux NDK)
wget https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip
mkdir -p ~/android
unzip android-ndk-r12b-linux-x86_64.zip -d ~/android

# Build once to confirm it works and generate proto libs (which will be reused).
export NDK_ROOT=~/android/android-ndk-r12b
export CC_PREFIX=ccache
tensorflow/contrib/makefile/build_all_android.sh \
-s tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in \
-t "libtensorflow_inference.so libtensorflow_demo.so"

Now create a file named "makefile_helper.bat" in tensorflow/contrib/makefile and add the following to it:
echo "BUILDING!"
bash -c 'NDK_ROOT=~/android/android-ndk-r12b CC_PREFIX=ccache tensorflow/contrib/makefile/build_all_android.sh -T -s tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in -t "libtensorflow_inference.so libtensorflow_demo.so"'
exit

(The '-T' will prevent it from redownloading and compiling protobuf.)
Update build.gradle buildNativeMade to the following:
task buildNativeMake(type: Exec) {
    workingDir '../../..'
    commandLine = ['cmd', '/C', 'start', 'tensorflow\\contrib\\makefile\\makefile_helper.bat']
}

Now, if you set buildWithMake = true`, it should create the native libs exactly where gradle expects to find them and copy them into the app dir.
This should work similarly for bazel on Windows, if you wish to install that under bash instead.
I'd prefer not to check in a separate helper script, so if anybody has luck getting the command to run in-line please let me know.

@bulatyauheni @AndreyRub
I tried to follow the steps to build android example.

imported examples/android/build gradle
Edited the path to pre-built so
def demoLibPath = '../libtensorflow_demo.so'
def inferenceLibPath = '../libtensorflow_inference.so'
I now get the following error
**Error:Execution failed for task ':buildNativeBazel'.

A problem occurred starting process 'command '/usr/local/bin/bazel''**
Please find the attached build file.

Any help would be very useful!
build.txt

@ramarajan09
Try to remove this task

Sorry I did not understand your comment.

@ramarajan09
Try to remove this task instead
task buildNativeBazel(type: Exec) {
workingDir '../../..'
commandLine bazelLocation, 'build', '-c', 'opt',
'tensorflow/examples/android:tensorflow_native_libs',
'--crosstool_top=//external:android/crosstool',
'--cpu=' + cpuType,
'--host_crosstool_top=@bazel_tools//tools/cpp:toolchain'
}

@bulatyauheni Thanks for pointing it out, I have now removed buildNativeBazel and copyNativeLibs.
Also, I created a folder call libs in my project folder and copied the four folders obtained from pre-builts (i.e benchmark model, libandroid_tensorflow_lib.lo, libtensorflow_demo.so, libtensorflow_inference.so). Each of these folders have arm64-v8a, armeabi-v7a, x86, x86_64 subfolders).
After building the app, the app throws up following error.
Process: org.tensorflow.demo, PID: 10513
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.tensorflow.demo-1/base.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_0_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_1_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_2_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_3_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_4_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_5_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_6_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_7_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_8_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.tensorflow.demo-1/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libtensorflow_demo.so"
at

If you unzip the apk, what do you see?

You dont define a good url of bazel:
def bazelLocation = '/usr/bin/bazel'

To update on this, a prebuilt TensorFlow AAR is now provided at https://ci.tensorflow.org/view/Nightly/job/nightly-android/lastSuccessfulBuild/artifact/out/tensorflow.aar
This contains tensorflow_inference_java.jar and tensorflow_inference.so native libs for armeabi-v7a, arm64-v8a, x86, and x86_64.
This means to integrate TF into your app built with Gradle, you can simply download the file to e.g. "aar/", and then adding the following into your gradle build file:
allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'aar'
        }
    }
}

dependencies {
    compile(name:'tensorflow', ext:'aar')
}

This will provide TensorFlowInferenceInterface as well as the full TF Java API. We'll be putting this up on jcenter soon so no manual downloading will be necessary, just a couple of Gradle lines.
Note that for the official Android demo in particular, you'll still need to download/build tensorflow_demo.so as well (which provides image conversion/object tracking support). We'll be adding a cmake build for this specifically to make it easier to build on Windows.

Hi Andrew,
Thank you very much for the suggestion.  Do you know where the libs folder would be, I'm having difficulty knowing where to drop the folders and if any paths need to change on the build.gradle file. Thanks.

@vyse8 The folder name is arbitrary, it's just relative to the build.gradle file. So for the TF android example you could create a tensorflow/examples/android/libs folder and put the aar in there. Then the snippet in my comment above would work to build in TF support.
An additinial step in the case of the TF demo is necessary: you'll want to remove mentions of libtensorflow_inference.so, tensorflow/java, and tensorflow/contrib/android from build.gradle so that gradle doesn't try to include them in the APK twice, now that these are being provided by the aar. We'll get this streamlined once we've got the AAR published on jcenter.

Hi Andrew,
Thanks for the quick follow-up.  I created the libs folder as you had suggested and it looks like I might be hitting a different error now.  Any ideas on what might cause this?
ERROR: C:/users/mattv/onedrive/documents/github/tensorflow/tensorflow/contrib/android/BUILD:72:1: error loading package 'tensorflow/core': Encountered error while reading extension file 'protobuf.bzl': no such package '@protobuf//': Traceback (most recent call last):
File "C:/users/mattv/onedrive/documents/github/tensorflow/tensorflow/workspace.bzl", line 98
_apply_patch(repo_ctx, repo_ctx.attr.patch_file)
File "C:/users/mattv/onedrive/documents/github/tensorflow/tensorflow/workspace.bzl", line 87, in _apply_patch
_execute_and_check_ret_code(repo_ctx, ["patch", "-p1", "-d", r...), <2 more arguments>])
File "C:/users/mattv/onedrive/documents/github/tensorflow/tensorflow/workspace.bzl", line 79, in _execute_and_check_ret_code
fail("Non-zero return code({1}) when ..., <2 more arguments>))
Non-zero return code(256) when executing 'patch -p1 -d C:/users/mattv/appdata/local/temp/_bazel_mattv/cpz5iwfo/external/protobuf -i C:/users/mattv/onedrive/documents/github/tensorflow/third_party/protobuf/add_noinlines.patch':
Stdout:
Stderr: java.io.IOException: CreateProcess(): The system cannot find the file specified.
and referenced by '//tensorflow/contrib/android:libtensorflow_inference.so'.
ERROR: Analysis of target '//tensorflow/examples/android:tensorflow_demo' failed; build aborted.
INFO: Elapsed time: 8.017s
My build.gradle is as follows:
// This file provides basic support for building the TensorFlow demo
// in Android Studio with Gradle.
//
// Note that Bazel is still used by default to compile the native libs,
// and should be installed at the location noted below. This build file
// automates the process of calling out to it and copying the compiled
// libraries back into the appropriate directory.
//
// Alternatively, experimental support for Makefile builds is provided by
// setting buildWithMake below to true. This will allow building the demo
// on Windows machines, but note that full equivalence with the Bazel
// build is not yet guaranteed. See comments below for caveats and tips
// for speeding up the build, such as as enabling ccache.
// Set to true to build with make.
// NOTE: Running a make build will cause subsequent Bazel builds to fail
// unless the contrib/makefile/downloads/ and gen/ dirs are deleted afterwards.
def buildWithMake = false
// Controls output directory in APK and CPU type for Bazel builds.
// NOTE: Does not affect the Makefile build target API (yet), which currently
// assumes armeabi-v7a. If building with make, changing this will require
// editing the Makefile as well.
def cpuType = 'armeabi-v7a'
// Output directory in the local directory for packaging into the APK.
def nativeOutDir = 'libs/' + cpuType
// Default to building with Bazel and override with make if requested.
def nativeBuildRule = 'buildNativeBazel'
def demoLibPath = '../../../bazel-bin/tensorflow/examples/android/libtensorflow_demo.so'
//def inferenceLibPath = '../../../bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so'
if (buildWithMake) {
nativeBuildRule = 'buildNativeMake'
demoLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_demo.so'
//inferenceLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_inference.so'
}
// Defines the NDK location for Makefile builds. Does not affect Bazel builds.
// Override with your absolute NDK location if this fails to get the location
// automatically.
def makeNdkRoot = System.getenv('NDK_ROOT')
// If building with Bazel, this is the location of the bazel binary.
// NOTE: Bazel does not yet support building for Android on Windows,
// so in this case the Makefile build must be used as described above.
def bazelLocation = 'c://tools//msys64//usr//bin//bash.exe'
project.buildDir = 'gradleBuild'
getProject().setBuildDir('gradleBuild')
// import DownloadModels task
project.ext.ASSET_DIR = projectDir.toString() + '/assets'
project.ext.TMP_DIR   = project.buildDir.toString() + '/downloads'
buildscript {
repositories {
jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'
}

}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
lintOptions {
    abortOnError false
}

sourceSets {
    main {
        // TensorFlow Java API sources.
        java {
            srcDir '../../java/src/main/java'
            exclude '**/examples/**'
        }

        // Android TensorFlow wrappers, etc.
        java {
            srcDir '../../contrib/android/java'
        }

        // Android demo app sources.
        java {
            srcDir 'src'
        }

        manifest.srcFile 'AndroidManifest.xml'
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = [project.ext.ASSET_DIR]
        jniLibs.srcDirs = ['libs']
    }

    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}

}
task buildNativeBazel(type: Exec) {
workingDir '../../..'
commandLine bazelLocation, 'build', '-c', 'opt',
'tensorflow/examples/android:tensorflow_native_libs',
'--crosstool_top=//external:android/crosstool',
'--cpu=' + cpuType,
'--host_crosstool_top=@bazel_tools//tools/cpp:toolchain'
}
//task buildNativeMake(type: Exec) {
// environment "NDK_ROOT", makeNdkRoot
// Tip: install ccache and uncomment the following to speed up
// builds significantly.
// environment "CC_PREFIX", 'ccache'
// workingDir '../../..'
// commandLine 'tensorflow/contrib/makefile/build_all_android.sh',
//  '-s',
//   'tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in',
//     '-t',
//      'libtensorflow_inference.so libtensorflow_demo.so'
//, '-T'  // Uncomment to skip protobuf and speed up subsequent builds.
//}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
dependencies {
compile(name:'tensorflow', ext:'aar')
}
//task copyNativeLibs(type: Copy) {
//from demoLibPath
//from inferenceLibPath
//  into nativeOutDir
//duplicatesStrategy = 'include'
//dependsOn nativeBuildRule
//fileMode 0644
//}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleDebug') {
task.dependsOn 'copyNativeLibs'
}
if (task.name == 'assembleRelease') {
task.dependsOn 'copyNativeLibs'
}
}
// Download default models; if you wish to use your own models then
// place them in the "assets" directory and comment out this line.
apply from: "download-models.gradle"

@vyse8 It appears you have no dependency remaining on the nativeBuildRule, so I'm not sure why you would be getting this bazel error. Are you sure you didn't change the build.gradle file after you got this error?
Also, if you were building with bazel on Windows, you wouldn't be able to simply change bazel to bash and have it work. You'd need to do something similar to the workaround with the helper script in my comment above.

@andrewharp I completely forgot to include the helper script.  I'm adding bash to my Windows now and will let you know how it looks after that.  I really appreciate the help.  Hoping to learn enough from this example to incorporate into academic work but tensorflow hasn't been too friendly so far ha.

@vyse8 Note that if you're going as far as to install bash for Windows to build libtensorflow_demo.so, then you might as well just build everything with make/Bazel. There's no real advantage to using the AAR file in this case.
Right now, the AAR is a better option if you're incorporating TF into a standalone app (that doesn't require libtensorflow_demo.so like the TF demo does). You can use it in the demo of course, but you'll also need to also download the nightly binaries for libtensorflow_demo.so here. You could also just download libtensorflow_demo.so there as well rather than the AAR (then you wouldn't need to mess with the Java source sets).
As mentioned we plan to keep streamlining this for Windows to make all approaches more straightforward.

@andrewharp thanks for the extra info.  My end goal is to leverage this into my standalone app, but I was hoping to learn the connections and calls via the example.  I think I might be confused on a few of the configuration options but I believe that I'm close.  In regards to the copyNativeLibs section of build.gradle, should this be commented out?
task copyNativeLibs(type: Copy) {
from demoLibPath
from inferenceLibPath
into nativeOutDir
duplicatesStrategy = 'include'
dependsOn nativeBuildRule
fileMode 0644
}
When I leave it uncommented I receive the following error within Android Studio:
Error:(148, 0) Could not get unknown property 'inferenceLibPath' for task ':copyNativeLibs' of type org.gradle.api.tasks.Copy.Open File
If I do comment out the CopyNativeLibs block then I receive the following when attempting to run within Android Studio:
Error:Could not determine the dependencies of task ':assembleDebug'.

Task with path 'copyNativeLibs' not found in root project 'android'.

Thoughts?
Thanks again.

@vyse8 You'll need to revert all the edits you made to build.gradle first before applying the edits from my bash for Windows workaround -- it can't find inferenceLibPath for example because you've commented it out.

Good point.  So I think I'm close thanks to your suggestions above.  Android Studio was able to install the apk but throws this error on launch:
04-21 17:18:37.945 3510-3510/org.tensorflow.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.tensorflow.demo, PID: 3510
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.tensorflow.demo-2/base.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_dependencies_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_0_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_1_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_2_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_3_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_4_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_5_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_6_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_7_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_8_apk.apk", zip file "/data/app/org.tensorflow.demo-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.tensorflow.demo-2/lib/x86, /system/fake-libs, /data/app/org.tensorflow.demo-2/base.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_dependencies_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_0_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_1_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_2_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_3_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_4_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_5_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_6_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_7_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_8_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-2/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libtensorflow_demo.so"
It seems like it might be having trouble finding the libtensorflow_demo.so still but I'm not sure where it wants it placed.  My build file now appears as follows:
// This file provides basic support for building the TensorFlow demo
// in Android Studio with Gradle.
//
// Note that Bazel is still used by default to compile the native libs,
// and should be installed at the location noted below. This build file
// automates the process of calling out to it and copying the compiled
// libraries back into the appropriate directory.
//
// Alternatively, experimental support for Makefile builds is provided by
// setting buildWithMake below to true. This will allow building the demo
// on Windows machines, but note that full equivalence with the Bazel
// build is not yet guaranteed. See comments below for caveats and tips
// for speeding up the build, such as as enabling ccache.
// Set to true to build with make.
// NOTE: Running a make build will cause subsequent Bazel builds to fail
// unless the contrib/makefile/downloads/ and gen/ dirs are deleted afterwards.
def buildWithMake = true
// Controls output directory in APK and CPU type for Bazel builds.
// NOTE: Does not affect the Makefile build target API (yet), which currently
// assumes armeabi-v7a. If building with make, changing this will require
// editing the Makefile as well.
def cpuType = 'armeabi-v7a'
// Output directory in the local directory for packaging into the APK.
def nativeOutDir = 'libs/' + cpuType
// Default to building with Bazel and override with make if requested.
def nativeBuildRule = 'buildNativeBazel'
def demoLibPath = '../../../bazel-bin/tensorflow/examples/android/libtensorflow_demo.so'
def inferenceLibPath = '../../../bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so'
if (buildWithMake) {
nativeBuildRule = 'buildNativeMake'
demoLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_demo.so'
inferenceLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_inference.so'
}
// Defines the NDK location for Makefile builds. Does not affect Bazel builds.
// Override with your absolute NDK location if this fails to get the location
// automatically.
def makeNdkRoot = System.getenv('NDK_ROOT')
// If building with Bazel, this is the location of the bazel binary.
// NOTE: Bazel does not yet support building for Android on Windows,
// so in this case the Makefile build must be used as described above.
def bazelLocation = 'c://tools//msys64//usr//bin//bash.exe'
project.buildDir = 'gradleBuild'
getProject().setBuildDir('gradleBuild')
// import DownloadModels task
project.ext.ASSET_DIR = projectDir.toString() + '/assets'
project.ext.TMP_DIR   = project.buildDir.toString() + '/downloads'
buildscript {
repositories {
jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.1'
}

}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
lintOptions {
    abortOnError false
}

sourceSets {
    main {
        // TensorFlow Java API sources.
        java {
            srcDir '../../java/src/main/java'
            exclude '**/examples/**'
        }

        // Android TensorFlow wrappers, etc.
        java {
            srcDir '../../contrib/android/java'
        }

        // Android demo app sources.
        java {
            srcDir 'src'
        }

        manifest.srcFile 'AndroidManifest.xml'
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = [project.ext.ASSET_DIR]
        jniLibs.srcDirs = ['libs']
    }

    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}

}
task buildNativeBazel(type: Exec) {
workingDir '../../..'
commandLine bazelLocation, 'build', '-c', 'opt',
'tensorflow/examples/android:tensorflow_native_libs',
'--crosstool_top=//external:android/crosstool',
'--cpu=' + cpuType,
'--host_crosstool_top=@bazel_tools//tools/cpp:toolchain'
}
task buildNativeMake(type: Exec) {
//environment "NDK_ROOT", makeNdkRoot
// Tip: install ccache and uncomment the following to speed up
// builds significantly.
//environment "CC_PREFIX", 'ccache'
workingDir '../../..'
commandLine = ['cmd', '/C', 'start', 'makefile_helper.bat']
//commandLine 'tensorflow/contrib/makefile/build_all_android.sh',
//  '-s',
//   'tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in',
//     '-t',
//      'libtensorflow_inference.so libtensorflow_demo.so'
//, '-T'  // Uncomment to skip protobuf and speed up subsequent builds.
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
dependencies {
compile(name:'tensorflow', ext:'aar')
}
task copyNativeLibs(type: Copy) {
from demoLibPath
from inferenceLibPath
into nativeOutDir
duplicatesStrategy = 'include'
dependsOn nativeBuildRule
fileMode 0644
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleDebug') {
task.dependsOn 'copyNativeLibs'
}
if (task.name == 'assembleRelease') {
task.dependsOn 'copyNativeLibs'
}
}
// Download default models; if you wish to use your own models then
// place them in the "assets" directory and comment out this line.
apply from: "download-models.gradle"
Any ideas?  I think you've almost got me there heh, sorry for how rookie I am with TF in general.

@vyse8 My guess is that you're running on an arm64 device, and since the app finds an arm64 variant of libtensorflow_inference.so (provided by tensorflow.aar) it expects to find the same for libtensorflow_demo.so. In this case you can fix this by changing  cpuType"armeabi-v7a" to "arm64-v8a".
Also note that you appear to now be manually building libtensorflow_inference.so in addition to grabbing it from the aar -- so you might want to go back and comment out those references or remove the dependency on the aar. Otherwise the behavior might get confusing.

@andrewharp Thanks again.  I went ahead and made the following changes to my build.gradle file(commented out the lib references and changed cpuType):
def cpuType = 'arm64-v8a'
// Output directory in the local directory for packaging into the APK.
def nativeOutDir = 'libs/' + cpuType
// Default to building with Bazel and override with make if requested.
def nativeBuildRule = 'buildNativeBazel'
def demoLibPath = '../../../bazel-bin/tensorflow/examples/android/libtensorflow_demo.so'
def inferenceLibPath = '../../../bazel-bin/tensorflow/contrib/android/libtensorflow_inference.so'
if (buildWithMake) {
nativeBuildRule = 'buildNativeMake'
//demoLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_demo.so'
//inferenceLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_inference.so'
}
I'm hitting the same error with the Unsatisfied Link Error upon launch, however it looks like this might be related to my jar file.  I don't think I ever added the JAR file for tensorflow but I remember it being in one of my downloads.  Is this necessary for the AAR implementation?  If so, where should this JAR file be placed?  I can't say for sure if that's throwing this error but it seems to be the general consensus online.

@vyse8 You don't need the jar if you're using the aar (nor do you need to refer to the tensorflow/contrib/android or tensorflow/java directories from gradle.build). The aar contains the jar + libtensorflow_inference.so.
You're building with make, so you definitely do not want to comment out the make demoLibPath. Otherwise Gradle won't be able to find libtensorflow_demo.so to place in the APK once it's built.
You can double check what's actually being put into the APK with unzip -v tensorflow_demo.apk (or whatever the actual apk filename is)

@andrewharp Thanks.  Okay so I added the demoLibPath references back in but the same error of Unsatisfied Link Error seen above is still occurring.  I'm thinking my file structure is the culprit since it can't find the SO files.  Is this appropriate?
My aar file is located in C:\Users\mattv\OneDrive\Documents\GitHub\tensorflow\tensorflow\examples\android\libs
Within Android Studio, I don't see my libs folder but it looks like there is a jniLibs folder with the same content (aar file).  I attempted to change my def nativeOutDir to jniLibs + cputype but encoutered the same issue so I've since changed it back.  Here is the full error that I see in the Android Monitor:
04-21 18:40:57.458 4041-4041/org.tensorflow.demo E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.tensorflow.demo, PID: 4041
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.tensorflow.demo-1/base.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_dependencies_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_0_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_1_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_2_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_3_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_4_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_5_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_6_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_7_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_8_apk.apk", zip file "/data/app/org.tensorflow.demo-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.tensorflow.demo-1/lib/x86, /data/app/org.tensorflow.demo-1/base.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_dependencies_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_0_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_1_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_2_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_3_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_4_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_5_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_6_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_7_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_8_apk.apk!/lib/x86, /data/app/org.tensorflow.demo-1/split_lib_slice_9_apk.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libtensorflow_demo.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at org.tensorflow.demo.TensorFlowImageClassifier.(TensorFlowImageClassifier.java:36)
at org.tensorflow.demo.TensorFlowImageClassifier.create(TensorFlowImageClassifier.java:0)
at org.tensorflow.demo.ClassifierActivity.onPreviewSizeChosen(ClassifierActivity.java:122)
at org.tensorflow.demo.CameraActivity$1.onPreviewSizeChosen(CameraActivity.java:159)
at org.tensorflow.demo.CameraConnectionFragment.setUpCameraOutputs(CameraConnectionFragment.java:421)
at org.tensorflow.demo.CameraConnectionFragment.openCamera(CameraConnectionFragment.java:428)
at org.tensorflow.demo.CameraConnectionFragment.access$000(CameraConnectionFragment.java:64)
at org.tensorflow.demo.CameraConnectionFragment$1.onSurfaceTextureAvailable(CameraConnectionFragment.java:95)
at android.view.TextureView.getHardwareLayer(TextureView.java:368)
at android.view.View.updateDisplayListIfDirty(View.java:15151)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15169)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16181)
at android.view.View.updateDisplayListIfDirty(View.java:15174)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15169)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15169)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:1618
Thanks.

@vyse8 What are the contents of the apk as seen with unzip -v?
I'm not sure why you'd have an aar in jnilibs unless you put it there yourself (and you probably shouldn't).
All you should need to do is change cpuType to "armeabi-v7a". The code is already set up to composite the directory name correctly for you.

@andrewharp From what I can tell it looks like anything that is placed in my libs folder gets moved to jnilibs. I believe this occurs because of the following lines in build.gradle
manifest.srcFile 'AndroidManifest.xml'
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = [project.ext.ASSET_DIR]
jniLibs.srcDirs = ['libs']
I went ahead and changed the cputype back to armeabi-v7a but still getting the libtensorflow_demo.so couldn't be found error.  I did find some additional info by using the Analyze apk feature in Android Studio.  It looks like at the root there is a lib folder, and within that folder are the types (x86, x86_64, arm64_v8a, armeabi-v7a).  However, within those folders, the only file listed in each one is libtensorflow_inference.so.  This would explain why it is having difficulty finding the libtensorflow_demo.so.  Should this file be located in the same directory ideally? I don't see it anywhere within the apk.
Also, if I were wanting to build the sample Hello World tensorflow example within Android, would I only need the latest inference file?  Thank you so much for all of this help btw.

@vyse8 In your situation I'd suggest just ignoring that the AAR even exists and following only the instructions in the original workaround. It's hard to tell what's going on if we don't even know what's in the APK (again, you can find out with unzip -v).

@andrewharp my apologies, I was unfamiliar with unzip so I equated it to Analyze APK, I see now that it provides a better output.
You might also try the this option for manually placing the prebuilts in the right place.
We'll have cmake working for libtensorflow_demo.so possibly next week, so really this is not worth spending too much time on.

@andrewharp thanks for your assistance. Now that I scroll up I realize I hit the same issue that ramarajan09 had 22 days ago prior to the AAR.  It looks like we both got the same exact error message so I'm not sure what is causing that for us.  From further analysis of the apk it looks like dragging it to an arbitrary created libs folder doesn't signal to the APK to include it in the build.  Do you know how these libs can be included as I think that would solve both of our issues?  Thanks.

@vyse8
The paths you're quoting there are where the files need to be copied from after they are built. If you put them in their destination manually, then they aren't even relevent. As you have them now it's seems to be pointing to tensorflow/examples/libs, which is incorrect both because that path doesn't exist (note the ..), and because I assume you meant tensorflow/examples/android/libs, which is actually the destination.
To clarify:
The AAR, if you use it, needs to go in an arbitrary folder that matches "aardir" in:
allprojects {
repositories {
jcenter()
flatDir {
dirs 'aardir'
}
}
}

The .so files, if placed manually, need to be put in the arbitrary folder that matches the "libs" in:
       jniLibs.srcDirs = ['libs']
The only restriction is possibly that these two dirs should be different -- my original instruction to place the AAR in libs/ may have been incorrect (I actually tested using a different directory).
Note that when AS shows you the project outline visually, I think it shows up as "jniLibs", though the actual folder on your HD is "libs".

I used the prebuilt libraries (copied the folder libs from the prebuilt APK as is in the root of the project) and modified the script as follows (I commented unnecessary tasks) and it is now building OK.
// This file provides basic support for building the TensorFlow demo
// in Android Studio with Gradle.
//
// Note that Bazel is still used by default to compile the native libs,
// and should be installed at the location noted below. This build file
// automates the process of calling out to it and copying the compiled
// libraries back into the appropriate directory.
//
// Alternatively, experimental support for Makefile builds is provided by
// setting buildWithMake below to true. This will allow building the demo
// on Windows machines, but note that full equivalence with the Bazel
// build is not yet guaranteed. See comments below for caveats and tips
// for speeding up the build, such as as enabling ccache.

// Set to true to build with make.
// NOTE: Running a make build will cause subsequent Bazel builds to *fail*
// unless the contrib/makefile/downloads/ and gen/ dirs are deleted afterwards.
def buildWithMake = false

// Controls output directory in APK and CPU type for Bazel builds.
// NOTE: Does not affect the Makefile build target API (yet), which currently
// assumes armeabi-v7a. If building with make, changing this will require
// editing the Makefile as well.
def cpuType = 'armeabi-v7a'

// Output directory in the local directory for packaging into the APK.
def nativeOutDir = 'libs/' + cpuType

// Default to building with Bazel and override with make if requested.
//def nativeBuildRule = 'buildNativeBazel'
def demoLibPath = 'libs/' + cpuType + 'libtensorflow_demo.so'
def inferenceLibPath = 'libs/' + cpuType + 'libtensorflow_inference.so'
//if (buildWithMake) {
//    nativeBuildRule = 'buildNativeMake'
//    demoLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_demo.so'
//    inferenceLibPath = '../../../tensorflow/contrib/makefile/gen/lib/libtensorflow_inference.so'
//}

// Defines the NDK location for Makefile builds. Does *not* affect Bazel builds.
// Override with your absolute NDK location if this fails to get the location
// automatically.
def makeNdkRoot = System.getenv('NDK_ROOT')

// If building with Bazel, this is the location of the bazel binary.
// NOTE: Bazel does not yet support building for Android on Windows,
// so in this case the Makefile build must be used as described above.
def bazelLocation = '/usr/local/bin/bazel'

project.buildDir = 'gradleBuild'
getProject().setBuildDir('gradleBuild')

// import DownloadModels task
project.ext.ASSET_DIR = projectDir.toString() + '/assets'
project.ext.TMP_DIR   = project.buildDir.toString() + '/downloads'

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
    }
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.2"

    lintOptions {
        abortOnError false
    }

    sourceSets {
        main {
            // TensorFlow Java API sources.
            java {
                srcDir '../../java/src/main/java'
                exclude '**/examples/**'
            }

            // Android TensorFlow wrappers, etc.
            java {
                srcDir '../../contrib/android/java'
            }

            // Android demo app sources.
            java {
                srcDir 'src'
            }

            manifest.srcFile 'AndroidManifest.xml'
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = [project.ext.ASSET_DIR]
            jniLibs.srcDirs = ['libs']
        }

        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

//task buildNativeBazel(type: Exec) {
//    workingDir '../../..'
//    commandLine bazelLocation, 'build', '-c', 'opt',  \
//         'tensorflow/examples/android:tensorflow_native_libs',  \
//         '--crosstool_top=//external:android/crosstool',  \
//         '--cpu=' + cpuType,  \
//         '--host_crosstool_top=@bazel_tools//tools/cpp:toolchain'
//}

//task buildNativeMake(type: Exec) {
//    environment "NDK_ROOT", makeNdkRoot
//    // Tip: install ccache and uncomment the following to speed up
//    // builds significantly.
//    // environment "CC_PREFIX", 'ccache'
//    workingDir '../../..'
//    commandLine 'tensorflow/contrib/makefile/build_all_android.sh',  \
//         '-s',  \
//         'tensorflow/contrib/makefile/sub_makefiles/android/Makefile.in',  \
//         '-t',  \
//         'libtensorflow_inference.so libtensorflow_demo.so'  \
//         //, '-T'  // Uncomment to skip protobuf and speed up subsequent builds.
//}

task copyNativeLibs(type: Copy) {
    from demoLibPath
    from inferenceLibPath
    into nativeOutDir
    duplicatesStrategy = 'include'
//    dependsOn nativeBuildRule
    fileMode 0644
}

tasks.whenTaskAdded { task ->
    if (task.name == 'assembleDebug') {
        task.dependsOn 'copyNativeLibs'
    }
    if (task.name == 'assembleRelease') {
        task.dependsOn 'copyNativeLibs'
    }
}

// Download default models; if you wish to use your own models then
// place them in the "assets" directory and comment out this line.
//apply from: "download-models.gradle"

Another update: libtensorflow_demo.so is now an optional library. If not present, YUV->RGB color conversion will be performed in Java (possibly slower), and object tracking will be disabled in the TF Detect demo, but otherwise things will work as usual.
This means the demo can be built on Windows with just the prebuilt tensorflow.aar dropped into your project folder. We're in the process of uploading this to jcenter, at which point it will only take a couple of lines of Gradle config to add a TF dep to Android projects.
Full cmake support for building TF is also still on the roadmap.

The AAR build of TF is now live! This is labeled 1.2.0 preview, but note that this is merely to indicate it comes between 1.1.0 and 1.2.0 (1.2.0 has not even been cut yet). We'll be updating it on every point release.
You can enable it by adding the following to build.gradle:
repositories {
    maven {
        url  "http://google.bintray.com/tensorflow"
    }
}
dependencies {
    compile 'org.tensorflow:tensorflow-android:1.2.0-preview'
}

You'll also want to remove the following to prevent redundant Java classes from being included:
            // TensorFlow Java API sources.
            java {
                srcDir '../../java/src/main/java'
                exclude '**/examples/**'
            }

            // Android TensorFlow wrappers, etc.
            java {
                srcDir '../../contrib/android/java'
            }

Also remove the reference to the built inference lib as well:
from inferenceLibPath
and
'libtensorflow_inference.so libtensorflow_demo.so' -> 'libtensorflow_demo.so'
We'll be cleaning this up to make it easier to switch soon.

Hi @andrewharp Just tried to follow some of the advice in here to get this running on Windows. I've found that by far the easiest method was to just download the nightly binaries and stick them in. I tried to use your above method to use the aar but I got an error saying that the compile method was not available. Seemed to suggest it was a gradle issue. Either way I couldn't fix and resorted to sticking the prebuilts in. Not sure if you've come across this?
On another note, this thread has lots of good information and is more detailed than the documentation. Are there plans to get the documentation up to spec to contain all this information? It's slightly unclear atm, especially regarding Windows. I did notice that you said some progress was being made. Thanks for your help.

@jubjamie Can you paste the exact error message please? Haven't seen that one before.
The README.md files have recently been updated with AAR instructions, and I'm working on a detailed getting started guide that will cover all of the approaches to building and integrating TensorFlow into apps.

@andrewharp I've got around the error so not able to get it up again I don't think. It seems to be a common error within android so i've put a very similar message below. Most solutions appear to suggest removing the compile line however that's for those specific stack overflow situations. Here it's not so simple.
Error:(9, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'AlexTest' may be using a version of Gradle that does not contain the method.
The build file may be missing a Gradle plugin.
link: Apply Gradle plugin

In my scenario I obviously had gradle installed etc. I noticed that in the latest release there is another compile call at the very end of build.gradle which it didn't pick up on (but I wonder if that is because it didn't get that far?). This was using android on Windows 10.
I was about to open another issue regarding performance of the android app using custom tensorflow for poets models (takes 5 times as long) but not sure it's really a bug or a stack overflow question. Can I email you? Otherwise I can open a stack overflow and paste the link here?

@jubjamie Ok -- I assume this sort of thing can be cleared up in Android Studio by just clicking to install/upgrade whatever Gradle-related thing it asks you to? Or were you building from the command line?
Re Inception: the performance of v3 (from the TF for Poets guide) is known to be slower than v1 (aka 5h, bundled with the demo). It's a much larger model so some difference is expected. Speeding it up is more of a Stack Overflow topic, but if you're interested you might try seeing what ops are taking up the most time on your device with benchmark_model.

As a note on performance, I've recently updated the TensorFlow for Poets script with the option to save out MobileNet models, which can be a lot smaller and faster than the default Inception v3, at the cost of some accuracy:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/tutorials/image_retraining.md#other-model-architectures
It looks like the original issue is fixed, or at least obsolete now though? I'm closing this for the moment, please reopen with more information if that's incorrect.

The link referring to the AAR build is now giving a 404. Has the link for this windows build method now changed?

So still no Windows support after a year when this issue was first brought up?  Just tried to build the demo.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildNativeBazel'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/local/bin/bazel''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:222)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:202)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:342)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
... 6 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/usr/local/bin/bazel'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
... 7 more
Caused by: java.io.IOException: Cannot run program "/usr/local/bin/bazel" (in directory "C:\GitProjects\tensorflow"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 10 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 more

there still no bazel support on windows, you can use cmake, but still its performance still no guarantee though


logging: Fix log_strdup detection on non-standard messages

Detection of missing log_strdup call was applied to every message
while it applies only to standard messages (string + arguments).
Appling it to hexdump messages could lead to fault as seen on
nrf9160_pca10090ns board.
Fix for bug introduced in the feature added by #16310.
Signed-off-by: Krzysztof Chruscinski<EMAIL_ADDRESS>

@nashif can we merge it?


Adding 2 numbers witout using + operator

rj011 /  Add 2 numbers in js without the + operator- a recursive approach / 13-10-22

Hello sir, please assign this issue to me as i already worked on this kind of project in past and has a great experience.


Fix  with single quotes

Resolves #144 with a small change to the regex to account for single or double quotes

P.S. I'm participating in Hacktoberfest 2021. If this PR is up to standard and merged, I'd appreciate if the hacktoberfest-accepted label could be added. Thanks!

I'm unsure how to do this... The tests don't fail on the warn message, and suckit seems to scrape <meta charset='utf-8'> and output <meta charset="utf-8">.

@lhvy Here's a test if you want to add it to the scraper.rs file:
    #[test]
    fn test_charset_parsing() {
        assert_eq!(Scraper::find_charset("<meta charset=\"UTF-8\">".as_bytes(), None), Some(String::from("utf-8")));
        assert_eq!(Scraper::find_charset("<meta charset='UTF-8'>".as_bytes(), None), Some(String::from("utf-8")));
    }

This just checks that the function returns the correct charset whether the value is between double quotes or single quotes


Update SilverSURF.toml for testnet-15

Description
All previous genesis validators should name their PRs "Update {validator_alias}.toml for tesntet-15" and provide links to previous PRs merged.
#1452
#2101
If this is an UPDATE for a previous genesis validator
Checks are made against your net_address. If this has changed since the previous testnet, make sure you provide links of previous prs merged from your previous git username.
Thanks in advance!
Checklist before merging

[ ] Only one toml is added in this PR
[ ] The file being added is indeed a .toml file
[ ] The toml being added is to the correct folder, and only to the correct folder
[ ] The eth_hot_key and eth_cold_key are present
[ ] The email, discord, elements telegram, and twitter fields are present and valid

Successfully validated transactions.toml file for commit hash bbda3ce

Successfully validated transactions.toml file for commit hash bbda3ce


added detailed testgrid report

see: https://github.com/encodeflush/ci-signal-report-tasks/issues/5


Unable to log into site.

Affected Version
4.6
Description
Unable to log in on new environment. We are looking to switch from a general vps to platform.sh.
We were able to get the site loading (all content, assets and theme works), however we are unable to log in.
Both the default user and password fails and known good credentials.
The site just reloads the log in page, no errors are produced in the logs or in browser or console.

Hi @nlighteneddesign, I’m afraid we don’t provide support via the issue tracker, I’d recommend trying our forums or Slack if you’re still stuck with this.
My suggestion would be to use SS_DEFAULT_ADMIN_USERNAME and SS_DEFAULT_ADMIN_PASSWORD to gain access to the CMS (more info here).

Those values were set. For other users having a similar issue it was a cookie issue.
Platform.sh requires you to whitelist cookies that can pass through and we had mis-configured the cookies Silverstripe uses.


Support option to set ssl_dir_path (aka CURLOPT_CAPATH)

This is motivated by #5703.
Similar to CURLOPT_CAINFO, but explicitly set the directory containing CA info:
https://curl.se/libcurl/c/CURLOPT_CAPATH.html
https://curl.se/libcurl/c/CURLOPT_CAINFO.html

I think that ssl_dir_path is a vague name and reading ssl_root_path makes me think "root directory" instead of "root of trust" like the comment says. So ssl_dir_path would be especially confusing. WDYT about having the names be ssl_capath and ssl_cainfo respectively although the latter would be a breaking change?

A few comments:

I agree, the names you propose are easier to understand.
We are taking a harder stance around breaking changes.  Is there a way we could continue to support the old name and add the new one.  Marking (with a comment for now) the old one as deprecated and with a planned date for removal (maybe 12 months from the date it is deprecated).
We do have some plans to provide an authentication library that would work for both gRPC and REST-based libraries.  It would introduce a new foo::Credentials type, and new attributes to control CAPATH, CAINFO and maybe other parameters.  It might be better to wait for that class.

Revisiting this issue. Is the correct order of operations?

Add an option similar to CARootsFilePathOption in credentials.h for CURLOPT_CAPATH
Add the corresponding to storage::ChannelOptions
Add the appropriate logic to storage::MakeOptions to use the new option

Potentially more work in other files for the new option?

The order looks correct, but let me add one step before that:

Figure out how to support this option with gRPC, or if that is not possible, how to express that some options are protocol-specific.

My prior (but I may have missed something) is that it is not possible to support CARootsFilePathOption with gRPC.  A second reading of the gRPC documentation, and maybe of the gRPC core functions would be in order.
Now, assuming there is no support in gRPC, then we have some choices to make:
-# Reimplement whatever OpenSSL does for these so we can support them with gRPC. That sound difficult, and maybe not a great idea.
-# Only support this for REST-based libraries (GCS is the only one today).  That would be sad, these are the "unified" credentials after all.
-# Maybe not support this at all. If there is no demand (or very little demand), then maybe the additional complexity is not justified.
Right now I am inclined to believe that the last option is the right one.  What do you think?

Less work sounds good.

Closing, we can reopen if somebody really needs this feature.


Cannot connect to Dooya DT360E

Hi,
I'm excited to find this project as I have 4 DT360E and I want to connected them directly to Homeassistant.
I followed the instructions, and have the following setup:

# Type of device. Valid options are 'lookup', 'multiple_lookup', 'rm', 'rm4', '$
#device_type = 'lookup' # use lookup
device_type = "dooya"
## lookup parameters
lookup_timeout = 240
local_address = '<IP_ADDRESS>'
## parameters for direct connection
device_host = '<IP_ADDRESS>'
device_mac  = 'c8:93:46:31:59:a5'

I get the following errors:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/broadlink/device.py", line 293, in send_packet
resp = conn.recvfrom(2048)[0]
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mqtt.py", line 596, in
devices = get_device(cf)
File "mqtt.py", line 400, in get_device
return configure_device(device, topic_prefix)
File "mqtt.py", line 404, in configure_device
device.auth()
File "/usr/local/lib/python3.6/dist-packages/broadlink/device.py", line 186, in auth
response = self.send_packet(0x65, payload)
File "/usr/local/lib/python3.6/dist-packages/broadlink/device.py", line 297, in send_packet
raise exception(-4000)  # Network timeout.
broadlink.exceptions.NetworkTimeoutError: [Errno -4000] Network timeout
oscar@ubunt1804:~/broadlink-mqtt$

Can you shred me some lights about what went wrong?  What's the correct configuration?

Did you try device_type='multiple_lookup' with correct local_address parameter?

I tried but none of the DT360E devices appear


Start the documentation

Here we have the tutorials dir at top-level, which makes Sphinx cranky.  So the docs conf script copies the contents of this folder down into the docs dir so that the Sphinx builder can find them.

This should be merged after #1 since it is built on that branch


Google Icon Misalignment is fixed

Pull Request Template
Title: Added Icon
Description
Google Icon misalignment is fixed.
Related Issue
Fixes #221
Fixes #219
Fixes #216
Changes Made
Google Icon misalignment is fixed.
Screenshots (if applicable)

Kindly review the PR.

Hey @Priyanshu1035,
Kindly create a new PR to develop branch.
Closing this PR as doesn't meet the PR requirements.


redesign task API to use sendable fns and be more approachable

I am currently working on redesigning the task API to use sendfn and be more approachable.  However, doing so exposed some bugs in sendfn so this is really blocked on me fixing those bugs.  Just wanted to get an issue in the tracker for it.
The basic changes so far are:

task::spawn takes a sendfn()
task::spawn_joinable uses a resource to send the succ/failure msg rather than the C++ code doing it

I plan to add a convenience wrapper for opening a bidirectional channel.  More radical redesign, for example to make it easier to layer extensions over spawning a task, might be in order but perhaps is better put off till after the release unless someone has a brilliant suggestion.

I fixed the bugs that were causing crashes and leaks.

This bug is done, fn@ and fn~ is another issue.


Buildings attributes UI

From @rainbowdesign on October 4, 2018 11:52
It would be nice to add an interface to the aquatuner that sets the target cooling temperature. It should change the power consume and heat output accordingly.
Copied from original issue: javisar/ONI-Modloader-Mods#73

From @Sijko on October 4, 2018 19:16
won't it make lags if many coolers?

For every building in fact.
Too much work for me.


Renaming repo workflow update #15575

Why:
Closes 15575

What's being changed:
Changed the tip callout to a note callout per recommendation in the maintainer notes. Updated the language in the note callout to to match the recommended explanation.

Check off the following:

[x] I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
[x] For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

[ ] This pull request impacts the contribution experience

[ ] I have added the 'writer impact' label
[ ] I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

@cmwilson21
Thanks so much for opening a PR! I'll get this triaged for review :zap:


Activating fullscreen via binary_sensor

Is your feature request related to a problem? Please describe.
I use Unifi Protect video streams with this awesome card. One of them is the doorbell. And I'd like to use the binary_sensor of the chime to automatically go to fullscreen with that stream for time x.
Describe the solution you'd like
As I´m not completely into the coding behind the card I'm not in the position to describe it in depth. Maybe something to react on binary_sensor? And a time how long Fullscreen should be stay enabled? :)
Describe alternatives you've considered
Digged through a lot of googled stuff but didn't find a suitable solution. If there is already something, please show me :)
Additional context
Add any other context or screenshots about the feature request here.

The issue with this is that browsers protect the user from random websites activating fullscreen mode. See my answer here -- the browser literally will not allow what this issue is asking for. This makes sense -- otherwise random websites could plunge their user into fullscreen Ad experiences ;-)
There may be ways around this involving opening new windows, or changing to subviews in HA -- but the request as written is essentially not feasible AFAIK :-(

With browser_mod its an ease so far. Or don't go real Fullscreen, just 100% screen width? In a Popup?
Sorry for not being more helpful, I just try to give my best :D

Yeah some trick like 100% width could work, but that's pretty much what subviews do (i.e. the card itself cannot change the space it is given, Home Assistant frontend controls that).
I'm not sure what browser_mod is doing -- does it let you activate fullscreen?

Maybe it does by using the Fully Kiosk APIs?

No, Fully Kiosk is not involved.
https://github.com/thomasloven/hass-browser_mod
Maybe I can work from this Integration and just use your Card inside of a Popup. I'll give it a try and let you know.

SG @Marfinho . This is a commonly requested feature, so I'd love to feature an FAQ entry if you find a workable way to get this to kind of work.

I've got this working using browser_mod yeah! I setup an automation to trigger the popup when someone is detected or the doorbell is pressed.
Here's the automation yaml:
alias: >-
  Doorbell Pressed OR Human Detected - Firefox browser full screen video feed
  for 20 seconds
description: ""
trigger:
  - platform: state
    from: "off"
    to: "on"
    entity_id:
      - binary_sensor.frontdoor_person_occupancy
  - platform: state
    entity_id:
      - binary_sensor.front_door_dahua_button_pressed
    to: "on"
condition: []
action:
  - service: browser_mod.popup
    data:
      size: wide
      timeout: 15000
      content:
        type: custom:frigate-card
        aspect_ratio: 55%
        cameras:
          - camera_entity: camera.frontdoor
            live_provider: ha
        menu:
          style: none
        live:
          controls:
            title:
              mode: none
    target:
      device_id:
        - d0e93101edfg44y3yt35y5y45y54y
mode: single

I also added my own "fullscreen" button to my frigate-hass-card with the following, it's really useful for a super quick "fullscreen" view:
elements:
  - type: custom:frigate-card-menu-icon
    icon: mdi:fullscreen
    tap_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.popup
        data:
          size: wide
          content:
            type: custom:frigate-card
            aspect_ratio: 55%
            cameras:
              - camera_entity: camera.frontdoor
                live_provider: ha
            menu:
              style: none
            live:
              draggable: false
              controls:
                title:
                  mode: none

Wow, that looks great!

Thank you @conorlap for the great example. I've added that to the documentation for now until we come up with a better idea ...
@felipecrs This is related to what I think you're suggesting, using the query parameters to take action: https://github.com/dermotduffy/frigate-hass-card/issues/929 (we still need something to get the browser to open that URL though). If you want to guide the implementation for that feature, chip in on that issue!

Well, the only idea I have is to use Fully Kiosk with its fully_kiosk.load_url service. Something like:
service: fully_kiosk.load_url
data:
  url: https://<ha>/lovelace/default_view?myparam=whatever
target:
  device_id: b5005de440d90c862538e61299d8d9f1


Trend display shows values for only last 3 months

Bar chart shows values (numbers) for all months
Test w/ at least 4 months of data and a positive trend

Won't do it. Three month is good for now.


chore: add integ test for hasOne relationship

Issue #, if available:
Description of changes:

Add integ test for HAS_ONE relationship
Update syntax for the CustomCreateDog test

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Codecov Report

Merging #778 (b049b77) into tagged-release/cms-support (d63d502) will not change coverage.
The diff coverage is n/a.

@@                     Coverage Diff                     @@
##           tagged-release/cms-support     #778   +/-   ##
===========================================================
  Coverage                       92.03%   92.03%
===========================================================
  Files                             115      115
  Lines                            4396     4396
  Branches                         1223     1223
===========================================================
  Hits                             4046     4046
  Misses                            329      329
  Partials                           21       21

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d63d502...b049b77. Read the comment docs.


COMPRESS-382

first draft of preventing OOM in LZMA

Coverage increased (+0.04%) to 84.215% when pulling 70594bcaff1d553cbd35312bb63a33bcba0680d3 on tballison:COMPRESS-382 into 08113862c5dda6dfb0562d84db8db8f5f41bfa4a on apache:master.

Coverage increased (+0.2%) to 84.437% when pulling 7d73baf10e435fcaa4927495afc185fb473c416b on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.

Coverage increased (+0.2%) to 84.437% when pulling 7d73baf10e435fcaa4927495afc185fb473c416b on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.

+1 to both suggestions.  Will do.  Thank you.

Coverage increased (+0.04%) to 84.274% when pulling b10528a62e51b2c5fdc0c4b7884cc93f03f8ce96 on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.

Coverage increased (+0.02%) to 84.26% when pulling 0e8ff9c44058afbca9c9126a8feebe41cd682626 on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.

Coverage increased (+0.03%) to 84.263% when pulling 26eab98e3a0d403587cc915eaa8f7d4b7b894cef on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.

Coverage increased (+0.06%) to 84.294% when pulling 2247ff9601374845012558ecf5963ebb7e1066c5 on tballison:COMPRESS-382 into 13a039029ca7d7fca9862cfb792f7148c555f05f on apache:master.


Highlight hovered inspector categories

As this is a visual change it is very subjective, but it just felt natural to give visual feedback about which category is being hovered over:

I found out that updating a control while handling a notification doesn't work, and used call_deferred to avoid the issue. Seeing that it isn't done this way very often is there a better solution? Funnily enough it works when adding a print statement before the call to update.

I definitely like this :slightly_smiling_face:
Is it possible to do the same for properties too?

I wasn't happy with how the highlighted properties looked, so here I'll leave it at the sections for this PR.

Thanks!

If this is wanted in the 3.x branch, a dedicated backport PR would be useful as there's a handful of conflicts and API renames to handle.


company ledger page - When delete project from unbilled project unbilled project list not refresh - Deepa Mam

Describe the bug
when we are try to delete project from unbilled project then unbilled project list not refresh so deleted project is displayed if we click on that page it shows blank page and shows error you do not have enough previldege
Screenshots

https://www.berrycast.com/conversations/0f3eb84f-6250-5d90-8e72-4e014104b328

#970
Explains this


Please update to 1.4.1 gradle plugins

Page https://plugins.gradle.org/plugin/org.akhikhl.gretty still say version 1.4.0 is latest.
And enable it in gradle recommended way:
plugins {
    id 'org.akhikhl.gretty' version '1.4.1'
}

fails:
* What went wrong:
Plugin [id: 'org.akhikhl.gretty', version: '1.4.1'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Gradle Central Plugin Repository (plugin 'org.akhikhl.gretty' has no version '1.4.1' - see https://plugins.gradle.org/plugin/org.akhikhl.gretty for available versions)

Duplicate of https://github.com/akhikhl/gretty/issues/325, I suppose.

Already updated, but to the 1.4.2 version.


testcase updates #180 #181 (fwp test cases are merged on previous PR #182)

the value of usd shall be at least 1 usd.
floating point shall be at least 0.0000001 * ONE_8 , floating point error occurs.
One good thing is that whenever we get unwrap panic error, it seems to be related to floating point math library error. For others, we were mostly able to catch up with specific error code  .
For the below error, I think investigation is required. Shouldn't this pass?
The error throwing contract call is this :
(contract-call? 'ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.yield-token-equation get-x-given-y u1000000000000 u1000000000000 u85000000 u1000000)
where pw-down term is u398107168 and exponential is u666666666 ,  which throws an error because the result is smaller than balance u1000000000000

As discussed, let's add CRP test cases to this PR and review.


Does not compile with Deno 1.6.0

Reporting here as the failing dependency causes this issue.
See https://github.com/udibo/collections/issues/7

I'll upgrade this and my other modules Friday Night or on Saturday. Thank you for letting me know about the issue with 1.6.0.

This issue has been resolved in<EMAIL_ADDRESS>


Make file_saver support wasm

I need to use Flutter Web with wasm for the application, but file_saver is not support wasm. Please make if support wasm

The support is added with the previous release


New version: WinMerge.WinMerge version 2.16.26

Result: Installation Successful

Manifest
Add/Remove Programs

Name
WinMerge
WinMerge <IP_ADDRESS> x64 (Current user, 64-bit)

Version
2.16.26
<IP_ADDRESS>

Publisher
Thingamahoochie Software
Thingamahoochie Software

ProductCode

WinMerge_is1

Auto-updated by vedantmgoyal2009/winget-pkgs-automation in workflow run 5559
Microsoft Reviewers: Open in CodeFlow

@wingetbot run

/AzurePipelines run

/azp run


net/url: export escaper with mode encodePath

What version of Go are you using (go version)?

$ go version
go version go1.13.4 darwin/amd64

Does this issue reproduce with the latest release?
It does.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tao.yang/Library/Caches/go-build"
GOENV="/Users/tao.yang/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/tao.yang/codes/gocodes"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.4/libexec"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/tao.yang/codes/gocodes/src/github.com/elastic/beats/filebeat/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2l/zkndzzg90t746hcwzwb9pbz00000gn/T/go-build399229267=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?
Use url.PathEscape to escape file system path.
package main

import (
	"fmt"
	"net/url"
)

func main() {
	fmt.Println(url.PathEscape((`/a?/b`)))
}

Notice that ? is a valid path character on Unix-like systems.
Don't we treat it as a query that follows.

What did you expect to see?
/a%3F/b

What did you see instead?
%2Fa%3F%2Fb

Why?
PathEscape is actually the path segment escaper.
// PathEscape escapes the string so it can be safely placed inside a URL path segment,
// replacing special characters (including /) with %XX sequences as needed.
func PathEscape(s string) string {
	return escape(s, encodePathSegment)
}

What I need is a path escaper, with mode == encodePath, not encodePathSegment. Something like:
func RealPathEscape(s string) string {
	return escape(s, encodePath)
}

Workarounds
escape path segments individually
package main

import (
	"fmt"
	"net/url"
	"strings"
)

func main() {
	segments := strings.Split(`/a?/b`, "/")
	for i, segment := range segments {
		segments[i] = url.PathEscape(segment)
	}
	fmt.Println(strings.Join(segments, "/"))
}

use EscapedPath
package main

import (
	"fmt"
	"net/url"
)

func main() {
	u := url.URL{Path: "/a?/b"}
	fmt.Println(u.EscapedPath())
}

I'm not sure I understand. If ? is a valid character in a filesystem path name, /a%3F/b would be incorrect. What are you trying to escape, or how are you using this escaped value?

Because the RealPathEscape does what http.FileServer does:
https://github.com/golang/go/blob/7d30af8e17d62932f8a458ad96f483b9afec6171/src/net/http/fs.go#L119-L123
Here, url.String() == url.EscapedPath().
For example, if we have a static file server:
package main

import "net/http"

func main() {
    http.Handle("/", http.FileServer(http.Dir(".")))
    http.ListenAndServe(":1234", nil)
}

Let's cURL it:
$ curl localhost:1234

a?/
server.go

Note that a?/ is escaped to a%3F/.

how are you using this escaped value?

While I'm manually rendering an HTML page.

/cc @bradfitz

The URL.EscapedPath method already does what you want:
https://play.golang.org/p/cOFqKqyM88y
fmt.Println((&url.URL{Path: "/This is/a path/?foo=bar"}).EscapedPath())

/This%20is/a%20path/%3Ffoo=bar

(The implementation of EscapedPath is basically just return escape(u.Path, encodePath))
Given what a fringe use case this is, I don't think we want to add a top-level func for this.

@bradfitz  So, you are saying that PathEscape() ≠ EscapedPath(). That's really confusing.


Fetch APM metadata from the trace-agent process

What does this PR do?
Fetch the trace-agent metadata from the trace-agent process itself rather than the local configuration. In a k8s context, the trace-agent runs in a different container with potentially a different config (the trace-agent API is available from the core-agent container).
Describe how to test/QA your changes
Test that config_apm_dd_url and feature_apm_enabled correctly reflect the trace-agent configuration when using our official helm chart and datadog-operator.
To see the payload: from the core-agent container agent diagnose show-metadata inventory-agent
For team trace-agent:

Check that the 2 metadata above are correctly sent when deploying the trace-agent with helm chart.

Reviewer's Checklist

[ ] If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
[ ] Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
[ ] A release note has been added or the changelog/no-changelog label has been applied.
[ ] Changed code has automated tests for its functionality.
[ ] Adequate QA/testing plan information is provided. Except if the qa/skip-qa label, with required either qa/done or qa/no-code-change labels, are applied.
[ ] At least one team/.. label has been applied, indicating the team(s) that should QA this change.
[ ] If applicable, docs team has been notified or an issue has been opened on the documentation repo.
[ ] If applicable, the need-change/operator and need-change/helm labels have been applied.
[ ] If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
[ ] If applicable, the config template has been updated.

/merge


[enhancement] on error add ability to open mangadex in browser

This can help with potential captcha

this is done with open in webview for now


[Github Action] Encounter error during install system dependencies

dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 32

Reference:
https://github.com/orgs/community/discussions/47863
https://github.com/actions/runner-images/issues/7192

close as completed with https://github.com/intel/webinizer/pull/15


Use a positive statement

utils/renderPostcss.js
Refactor to use a positive statement instead.
From
const map = !config.general.isProduction ? { inline: input.map.toString() } : false;
To:
const map = config.general.isProduction ? false : { inline: input.map.toString() } ;

Totally agree with this.
I also would add that, when one of the results of the ternary operator is boolean you can simplify this with only && or || operators. in this case this is clearer and simpler:
const map = config.general.isProduction && { inline: input.map.toString() } ;

The possible results are false || { inline: input.map.toString() }  which is the expected output

For me this ternary version is less readable. I know it works but I have to spend more time reading the line to know what the return is. Don't know I'm wired this way 😁

What do you mean by "ternary is less readable"?
Ternary is const x = boolean ? caseA : caseB
But what I did is a conditional assignment const x = boolean && caseA

In any case you are right, ternaries are easier to read.
+1 for maintainability.


CAS-495 Include more callsite information in trace events.

Created custom formatter for default subscriber to include
additional information such as file and line number.

Custom formatter will also only generate ansi escape sequences to display LEVEL in colour
if stdout is attached to a terminal.

bors try

I would change the format slightly from
[2020-11-16T10:58:42.181733780+00:00 DEBUG mayastor::subsys::nvmf::target] (target.rs:292) enabling discovery for target
to
[2020-11-16T10:58:42.181733780+00:00 DEBUG mayastor::subsys::nvmf::target::target.rs:292] enabling discovery for target
but that'd just be my personal preference :)

There is a reason for the separation. The format of the message line is actually the following:
[TIMESTAMP LEVEL TARGET] CONTEXT (LOCATION) MESSAGE
Now the CONTEXT part will only be present for spans/instrumented functions.

bors try

bors try

bors check

bors try

bors merge


Which flavor of Markdown?

Which flavor of Markdown is supported? CommonMark? Shouldn't it be added to the readme.md?
It would be good to support Markdown Extra, so Ink could be used within system which render using the original PHP lib.

@robsonsobral, Ink currently supports GFM which is a superset of CommonMark. I'll leave this issue open as a task to update the README. As for Markdown Extra, I'll have to dig in and see what it would take to add support.

I'm not sure all features can be implemented using Markdown-it, but some can. However, I know nothing about CodeMirror.


[WIP] Depoly real env found issues fix

Let's wait a moment in order to fix all related bug in one PR.

recheck

recheck

recheck


nodejs: Set NODE_GYP only if it doesn't have a value already

This helps us to specify additional flags that are needed for building JS bindings for different targets using node-gyp.
Signed-off-by: Sudarsana Nagineni<EMAIL_ADDRESS>

:+1:

+1


Add API Token Auth Support

Add the support for auth with API Token
How it works
the class now parse the password parameter ($this->password). if there a ":" in password they will be use token authentification.
if not the class is use username + password authentification
So the class is compatible backwards
How to use
Login with username & password:
$pve2 = new PVE2_API("hostname", "username", "realm", "password");
Login with API Token:
$pve2 = new PVE2_API("hostname", "username", "realm", "TokenID:TokenValue");
Example:
$pve2 = new PVE2_API("hostname", "root", "pam", "TestToken:7381a050-0185-43d1-a651-0c30a2bba5cc");

I think that using the presence of a colon in the password is too unpredictable, especially in current times.
Perhaps if the password field is null when PVE2_API is initiated, a new field in the request can be checked?

hostname
username
realm
password
ticket


Create CODE_OF_CONDUCT.md and LICENSE files

Adds a code of conduct for the project.

@vinitkumar thanks! I'll merge this


Add trouble shooting guide for networking issues.

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: baodongli
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: frankbu
If they are not already assigned, you can assign the PR to them by writing /assign @frankbu in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

content/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

thanks @sdake @john-a-joyce for your review comments. See updates.

Might try a rebase to fix these problems.  Can't merge with a red gate:
https://circleci.com/gh/istio/istio.github.io/4389?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Please use https://github.com/istio/istio.github.io/blob/master/content/help/ops/traffic-management/proxy-cmd/index.md to rework this page.

You have some broken links:

./public/help/ops/traffic-management/troubleshooting/index.html

internally linking to docs/tasks/security/mutual-tls/#verifying-keys-and-certificates-installation, which does not exist (line 1)
Mutual TLS
internally linking to help/ops/misc/#verifying-connectivity-to-istio-pilot, which does not exist (line 1)
Verifying connectivity to Istio Pilot
internally linking to help/ops/traffic-management/proxy-cmd/, which does not exist (line 1)
Debugging Envoy and Pilot
trying to find hash of docs/tasks/security/mutual-tls/#verifying-keys-and-certificates-installation, but /root/site/public/help/ops/traffic-management/troubleshooting/docs/tasks/security/mutual-tls does not exist (line 1)
Mutual TLS
trying to find hash of help/ops/misc/#verifying-connectivity-to-istio-pilot, but /root/site/public/help/ops/traffic-management/troubleshooting/help/ops/misc does not exist (line 1)
Verifying connectivity to Istio Pilot

My suggestion would also be to just add a step at the top that uses proxy-status to verify all pods are present and all xDS is either SYNCED or NOT SENT. Then go onto the remaining steps.
If it's not present then Envoy can't communicate with Pilot. If things are stale then Envoy is refusing the config its being sent, Pilot is having perf issues or there is just some general network slowness.

New changes are detected. LGTM label has been removed.

@rcaballeromx Thanks for your good suggestions. I've fixed them to most extent.

Hi. This document is still talking about everything other than Istio itself. This is less likely to be useful to end users who are troubleshooting why they can't talk to google.com (an issue that @Stono had), or why http rewrites are not working (because the ports were not named as http-*). Or why users are seeing 503s (because subsets are added after virtual service). These are the things that SREs should know when dealing with Istio. Once again, if you look at the mailing lists and browse through the user issues over the last year, you would find that these are the usual issues/gotchas people come across.
All the other connectivity stuff is already covered by Kubernetes SRE guide (https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).
I chatted with @frankbu / @vadimeisenbergibm / @liamawhite / @Stono and few others. They have agreed to contribute all the stuff related to Istio networking (service entries, gateway conflicts, port conflicts, etc.). to this section in a separate PR. Lets hold off on this until that doc goes in and then see whether the content here fits in that doc.

@rshriram Please include me as a reviewer on that PR. I will hold my second review of this PR until we get that in.

I've published further improvements. @baodongli @john-a-joyce What is the status of this PR should I keep reviewing?


Button issue

when running, it gives an error that states that the button class cannot be within a PDE file with the same name. upon changing this it gives more errors this spawning code

i cant download

you have to open spiderevosim.pde first, which makes it the main file.
you tried to make button main which generated this error

yeah, i now realize that

did your mother never teach you to say "please" and "thank you"?


Limit to decimal part

Not an issue ...just a request.
Is it possible to set a limit for the decimal part of the floating number output?...For example limit to 6 or 8 figures the decimals.
Thanks.

Sorry I don't think that's too useful when you can just wrap a native PHP function around it:
round(convertDMSToDecimal($n),6)


Minor typos / clarification of doc strings

Excuse the drive-by PR. I'm guessing a bit on aways--> always but it seems to match the implementation.

👋 Bobby.

👋 @mitchellh !


HTML styling and line breaks for cell values

If text is style in draw.io, the exported XML will contain a value attribute with encoded HTML.
e.g. for bold text value="TEST"
Similarly, exported diagrams where cells have multiple lines of text will contain at least one of
,
, or
 in their values
Is your feature request related to a problem? Please describe.
Blocking migration from draw.io exports
Describe the solution you'd like
Parsing HTML with styling. Alternately, provide an option for stripping out the HTML from the value
Describe alternatives you've considered
I've also tried with unencoded HTML (e.g. value=" TEST ") which results in a Maximum call stack size exceeded. error
Additional context

Hi thanks for your feedback.
Could you please share the XML file or content to let me better understand what you describe?
draw.io includes a lot of addons around mxGraph, so I am not sure that mxGraph itself is able to correctly display a Graph is the exact same way as draw.io does.
I am pretty sure that in your case, the style of the cells that includes HTML content in their label are configured with html=1. This is the drawio way to enable the HTML support in label for a specific cell.
This specific style doesn't exist in mxGraph nor maxGraph. However, it is possible to enable it globally for a graph instance by setting Graph.setHtmlLabels(true)

Hi @hbmartin can you please share more details about your problem?

Hi @tbouffard thanks for the followup.
My use case is to display diagrams from drawio which embeds html tags in the value attribute e.g. the attached.
I don't think the Graph.setHtmlLabels behaved as I expected when I last tried it but I'll take another look.

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15" version="24.8.3">
  <diagram name="Page-1" id="E3DY-f58wHxxqdYJRZFw">
    <mxGraphModel dx="1300" dy="886" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="OHFwSiCPEaL5BbWed95m-2" value="Simple Test" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
          <mxGeometry x="365" y="260" width="120" height="60" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>

Thanks for the XML, I will do some tests in the next days to see if a solution is available out of the box.

Hi @hbmartin
I have been able to make maxGraph consider the cell value as HTML contents by setting graph.setHtmlLabels(true).
I did that updating the existing js-example which loads an XML source to fill the model. This example uses the maxGraph XML format, but it also works when using the original mxGraph XML format.
The code is available in #594


Adding some documentation

This package needs some documentation.
Starting some here.

I'll add more later, this is just to have the basis