Nativescript Webpack无法构建

时间:2018-11-11 08:00:23

标签: angular webpack nativescript

使用tns运行android进行项目建设很愉快

为了减少启动时间,我已经安装了

npm install --save-dev nativescript-dev-webpack

npm安装

然后 tns运行android --bundle

并出现以下错误。 ............. 失败:构建失败,并出现异常。

  • 出了什么问题: 无法将消息发送到守护程序。 .............

这是package.json

{
  "nativescript": {
    "id": "com.business.bapp",
    "tns-android": {
      "version": "4.2.0"
    },
    "tns-ios": {
      "version": "4.2.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@angular/animations": "~6.1.0",
    "@angular/common": "~6.1.0",
    "@angular/compiler": "~6.1.0",
    "@angular/core": "~6.1.0",
    "@angular/forms": "~6.1.0",
    "@angular/http": "~6.1.0",
    "@angular/platform-browser": "~6.1.0",
    "@angular/platform-browser-dynamic": "~6.1.0",
    "@angular/router": "~6.1.0",
    "nativescript-angular": "~6.1.0",
    "nativescript-phone": "^1.4.0",
    "nativescript-pro-ui": "^3.4.1",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "^3.7.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~6.2.0",
    "tns-core-modules": "~4.2.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.1.0",
    "@nativescript/schematics": "~0.3.0",
    "@ngtools/webpack": "~6.2.0",
    "mini-css-extract-plugin": "^0.4.4",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "^0.17.0",
    "typescript": "~2.7.2",
    "webpack": "^4.25.1",
    "webpack-cli": "^3.1.2"
  },
  "readme": "NativeScript Application"
}

有关该错误的更多详细信息:

> :app:preDebugBuild > Resolve files of :app:debugCompileClasspathipt\xxxxxxx\node_modules\tns-core-modules-w
E:\xxxxxx\platforms\android\app\src\main\java\com\tns\gen\com\telerik\widget\list\ListViewDataSourceAdapter_vendor_77572_32_ListViewDataSourceAdapter.java:41: error: getItemViewType(int) in ListViewDataSourceAdapter_vendor_77572_32_ListViewDataSourceAdapter cannot override getItemViewType(int) in ListViewDataSourceAdapter
        public int getItemViewType(int param_0)  {
                   ^
  overridden method is final
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

2 个答案:

答案 0 :(得分:1)

nativescript-pro-ui已过时,请将其删除,然后重试。

答案 1 :(得分:0)

我可以通过删除

解决此错误

“ nativescript-pro-ui”:“ ^ 3.4.1”,

来自package.json

感谢this的帖子。在我阅读this帖子时,Manoj的回答相同。谢谢Manoj。

但是现在与android.content.res.Resources $ NotFoundException相关的其他错误:资源ID#0xfffffff6 已经出现了,我可能会再开一篇帖子。

解决资源错误的方法是here