android: Couldn't find 'platforms/android/build-tools/sbg-bindings.txt' bindings input file

@rakeshgirase commented on Tue Jun 04 2019

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.4.0
  • Cross-platform modules: 5.4.1
  • Android Runtime: 5.4.0
  • iOS Runtime: NA
  • Plugin(s):

Describe the bug

After upgrade to NS 5.4.0, when Legacy Workflow is disabled in nsconfig.json file, local and cloud build breaks with following error message:

Exception in thread "main" java.io.IOException: Couldn't find '/home/circleci/repo/platforms/android/build-tools/sbg-bindings.txt' bindings input file. Most probably there's an error in the JS Parser execution. You can run JS Parser with verbose logging by executing "node '/home/circleci/repo/platforms/android/build-tools/jsparser/js_parser.js' enableErrorLogging".
	at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:126)
	at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
	at org.nativescript.staticbindinggenerator.Main.main(Main.java:48)

The build runs fine if legacy Workflow is switched on. I updated the webpack.config.js file as mentioned in https://docs.nativescript.org/releases/upgrade-instructions but the build still fails. If required complete logs can be found at https://circleci.com/gh/rakeshgirase/CloudBuild/115. Earlier successful build is which uses legacyWorkflow and passes https://circleci.com/gh/rakeshgirase/CloudBuild/103.

To Reproduce

Simply clone sample project https://github.com/rakeshgirase/CloudBuild.git and run tns build android

Expected behavior The build should be successful when legacy workflow is disabled.

Sample project

The sample project can be found at https://github.com/rakeshgirase/CloudBuild.git.

Additional context

I asked getting help on this on SO as well https://stackoverflow.com/questions/56379865/nativescript-5-4-0-build-fails-with-couldnt-find-sbg-bindings-txt but no luck.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

@rakeshgirase the problem is that when using the circle CI cache it copies the node_modules folder from the previous build and npm install does nothing as all the packages are present, but we need some post install scripts to be run as they are adding some hooks needed by the NativeScript CLI, so there are two possible solutions for the problem:

  1. Remove hooks/ from the .gitignore file and check in the hooks folder in the repo.
  2. [Recommended] Add additional build step in the Circle CI - npm rebuild which will trigger all the postinstall scripts which will add the needed hooks.

I am getting this behavior on NS 8 and @nativescript/webpack v 5.0.17

I had this error on local build after updating and for me the solution was this one: https://stackoverflow.com/a/56740058

From the project root run ./node_modules/.bin/update-ns-webpack --deps --configs This updates package.json and node_modules. Then I removed the following folders: node_modules, platform, hooks And do a clean run: tns run android