ionic-team / ionic-team/ionic-cli

Building Android with --production flag prevents cmd/script from exiting properly

未關閉
#3,349 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
triage
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

# Bug Report

**Ionic Info**

```
cli packages: (C:\Users\Administrator\AppData\Roaming\nvm\v9.4.0\node_modules)

@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0

System:

Node : v9.4.0
npm : 5.6.0
OS : Windows 10

Misc:

backend : pro
```

**Describe the Bug**

Building a production build of a ionic cordova android apk causes batch scripts to hang indefinitely until the script window is force terminated. Note this only happens when using the --release flag. If the release flag is not used, then batch scripts exit successfully

i.e.
```
Running `ionic cordova build android` builds a valid APK and exits with 0

Running 'ionic cordoca build --release android' builds a valid APK but hangs on exit. It appears there is a npm process in the background preventing cmd from fully exiting when using the --production flag
```

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Launch a new CMD terminal
2. Enter a Ionic workspace that can be build for Android
3. Run `ionic cordova build android` and wait for it to finish the build
4. Run `exit 0'
5. Note that CMD terminal should close successfully
6. Launch a new CMD terminal
7. Enter the same Ionic workspace as before
8. Run `ionic cordova build --release android` and wait for it to finish the build
9. Run `exit 0'
10. Note that CMD terminal hangs and has to be force closed

**Expected Behavior**
running `ionic cordova build --release android` should exit successfully after successful or failed builds without hanging the CMD instance.

**Additional Context**
This issue is preventing our build system from continuing after building a APK flagged with the --release flag. The only work around we have been able to find is to not use the production flag

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing the difference between `ionic cordova build android` and `ionic cordova build --release android` in a Windows CMD terminal. Trace the CLI entry point for the Android release build and its npm child process, comparing process cleanup with the non-release path. Done means successful and failed release builds return control to CMD without leaving a background process.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, node.js, typescript
領域
build-system, cli, mobile
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。