Nativescript 5.4.0构建失败,并显示“找不到sbg-bindings.txt”。 [英] Nativescript 5.4.0 build fails with "couldn't find sbg-bindings.txt"
问题描述
Nativescript发布了5.4.0,默认情况下启用了hmr。升级到5.4.0后,我的nativescript云版本以及本地版本开始中断,并显示以下错误消息:
Nativescript released 5.4.0 where hmr is enabled by default. After upgrade to 5.4.0, my nativescript cloud build as well as local build started breaking 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 following is a relevant code snippet which has changed.
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 。
When useLegacyWorkflow is set to true, the build works fine but I need to move away from legacy workflow. If required complete logs can be found at https://circleci.com/gh/rakeshgirase/CloudBuild/106. Earlier successful build is which uses legacyWorkflow and passes https://circleci.com/gh/rakeshgirase/CloudBuild/103.
由于我没有对代码进行任何更改,因此似乎与环境设置有关。
Since I have not made any changes to the code, it seems something to do with the environmental settings.
有任何想法吗?
推荐答案
解决方案如下:
从项目根目录运行
./node_modules/.bin/update-ns-webpack --deps --configs
这将更新package.json和node_modules。
This updates package.json and node_modules.
然后我删除了以下文件夹。
Then I removed the following folders.
node_modules, platform, hooks
并执行干净运行
tns run android
这篇关于Nativescript 5.4.0构建失败,并显示“找不到sbg-bindings.txt”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!