_From @ishitatsuyuki on May 5, 2017 11:10_
This is the tracking issue for gradlew failure on :asbg:generateBindings.
Workaround found:
rm platforms/android/build-tools/android-static-binding-generator/*.txt
The aim of this issue is to resolve the root cause of the problem. The check of duplicate entries was introduced in https://github.com/NativeScript/android-runtime/commit/53cc589822ef0395297d3120dec795737c698829.
_Copied from original issue: NativeScript/nativescript-dev-webpack#145_
Gotcha, removing the dirty bindings.txt will solve this problem. The easiest way to do this is adding fs.unlinkSync(outFile) to https://github.com/NativeScript/android-runtime/blob/40dd832/android-static-binding-generator/project/parser/js_parser.js#L74.
I believe this make incremental compilation act as intended (less rebuild than before), but I'm not confident (no easy way to test and prove it).
Also, unlinkSync doesn't look very well, there should be some refactor such as opening the file with truncation flag, and store it's fd as global variable (PS: don't forget to close it).