Сборка Nativescript 5.4.0 завершается с ошибкой «не удалось найти sbg-bindings.txt» - PullRequest
1 голос
/ 30 мая 2019

Nativescript выпустил 5.4.0, где hmr включен по умолчанию. После обновления до 5.4.0 моя облачная сборка nativescript и локальная сборка перестали работать со следующим сообщением об ошибке:

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)

Ниже приведен соответствующий фрагмент кода, который был изменен.

package.json

{
  nativescript: {
    id: "com.sample.drawer.app",
    tns-ios: {
      version: "5.4.0"
    },
    tns-android: {
      version: "5.4.0"
    }
  },
  description: "NativeScript Application",
  license: "SEE LICENSE IN <your-license-filename>",
  repository: "<fill-your-repository-here>",
  scripts: {
    lint: "tslint "
    app/**/*.ts
    "",
    tsc: "tsc"
  },
  dependencies: {
    nativescript-theme-core: "~1.0.4",
    nativescript-ui-sidedrawer: "~5.0.0",
    rxjs: "~6.2.0",
    tns-core-modules: "^5.4.1"
  },
  devDependencies: {
    nativescript-dev-sass: "~1.6.0",
    nativescript-dev-typescript: "~0.7.0",
    nativescript-dev-webpack: "~0.18.0",
    tslint: "~5.11.0",
    typescript: "~3.2.2"
  },
  readme: "NativeScript Application"
}

nsconfig.json

{
  "useLegacyWorkflow": false
}

Когда для useLegacyWorkflow установлено значение true, сборка работает нормально, но мне нужно отойти от устаревшего рабочего процесса. При необходимости полные журналы можно найти по адресу https://circleci.com/gh/rakeshgirase/CloudBuild/106. Ранее успешная сборка, которая использует legacyWorkflow и передает https://circleci.com/gh/rakeshgirase/CloudBuild/103.

Поскольку я не внес никаких изменений в код, похоже, что-то связано с настройками среды.

Есть мысли?

1 Ответ

1 голос
/ 24 июня 2019

Решение было следующим:

Из корневого каталога проекта запустите

./node_modules/.bin/update-ns-webpack --deps --configs

Это обновит package.json и node_modules.

Затем я удалил следующие папки.

node_modules, platform, hooks

И сделать чистую пробежку

tns run android
...