【问题标题】:Im not able to build ionic2 app我无法构建离子应用程序
【发布时间】:2016-11-09 14:53:36
【问题描述】:

我正在尝试构建和 ionic 2 应用程序来测试我的 android,但我什么也没得到。

我的设置(离子信息):

科尔多瓦 CLI:5.1.1 Gulp 版本:CLI 版本 3.9.1 吞咽本地:
离子框架版本:2.0.0-rc.0 离子 CLI 版本:2.1.0 离子应用程序库版本:2.1.0-beta.1 操作系统:发行商 ID:Ubuntu 描述:Ubuntu 14.04.3 LTS 节点版本:v5.11.0

我的依赖:

  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/compiler-cli": "0.6.2",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/platform-server": "2.0.0",
    "ionic-angular": "2.0.0-rc.0",
    "ionicons": "3.0.0",
    "@ionic/storage": "1.0.3",
    "ionic-native": "2.0.3"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.36", 
    "typescript": "2.0.3" 
  }

控制台消息是(ionic build android):

Running 'build:before' npm script before build
> ionic-app-base@ build /home/fdom/repos/Pantrify
> ionic-app-scripts build
[15:38:53]  ionic-app-scripts 0.0.36 
[15:38:53]  build prod started ... 
[15:38:53]  clean started ... 
[15:38:53]  clean finished in 9 ms 
[15:38:53]  copy started ... 
[15:38:53]  ngc started ... 
[15:38:53]  copy finished in 339 ms 
[15:38:53]  lint started ... 
[15:38:56]  lint finished in 2.52 s 
[15:39:21]  ngc finished in 28.49 s 
[15:39:21]  bundle started ... 
[15:39:35]  bundle finished in 13.74 s 
[15:39:35]  uglifyjs started ... 
[15:39:35]  sass started ... 
[15:39:40]  sass finished in 4.88 s 
[15:39:40]  cleancss started ... 
[15:39:43]  cleancss finished in 3.42 s 
[15:39:52]  uglifyjs finished in 16.86 s 
[15:39:52]  build prod finished in 59.12 s
prompt>_

但如果运行离子发球,它会完美:

Running 'serve:before' npm script before serve
> ionic-app-base@ watch /home/fdom/repos/Pantrify
> ionic-app-scripts watch
[15:50:20]  ionic-app-scripts 0.0.36 
[15:50:20]  watch started ... 
[15:50:20]  build dev started ... 
[15:50:20]  clean started ... 
[15:50:20]  clean finished in 6 ms 
[15:50:20]  copy started ... 
[15:50:20]  transpile started ... 
[15:50:21]  lint started ... 
[15:50:23]  lint finished in 2.46 s 
[15:50:25]  transpile finished in 4.69 s 
[15:50:25]  bundle started ... 
[15:50:25]  copy finished in 4.76 s 
[15:50:36]  bundle finished in 10.69 s 
[15:50:36]  sass started ... 
[15:50:40]  sass finished in 3.84 s 
[15:50:40]  build dev finished in 19.24 s 
[15:50:40]  watch ready in 19.57 s 
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $ 

我尝试了很多,删除/添加平台,卸载/安装节点模块,使用 nvm(4.4.0, 5.11.0, 5.6.0) 构建另一个节点版本,但没有任何效果。我认为它是离子 cli,但不确定。

非常感谢

【问题讨论】:

    标签: android cordova ionic-framework ionic2


    【解决方案1】:

    我认为你应该使用以下命令:

    $ionic platform remove android
    $ionic hooks add 
    $ionic platform add android
    

    【讨论】:

    • 我试试这个,也许这是我可以完美构建的解决方案。
    猜你喜欢
    • 1970-01-01
    • 2019-08-12
    • 2018-12-12
    • 1970-01-01
    • 2020-05-08
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多