ionic-team / ionic-team/ionic-cli

Using cli 4.0 RC.0 we run into an error for android release build

未關閉
#3,025 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
TypeScript
星號
2k
分支
681
PR 合併指標
30 天內沒有已合併 PR

描述

Description:
We are testing your 4.0 RC cli as requested in the readme file 😄
We have an ionic 3.9.2 app, but doing a simple android release build does not work for us, this is what we have done:

sudo npm i -g ionic@rc
ionic cordova build android --release

Steps to Reproduce:
If we do a UNSIGNED release on a fresh IONIC3 app with your new CLI 4 RC.0 we do not get the error, not sure if the problem is the app, cordova or the SIGNING method. But for sure the problem is only on --release tag

But if we revert to @latest cli the build is working again.

Output:
This is our output what we get

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformDexWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: 
java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define 
Lcom/google/android/gms/actions/ItemListIntents;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
36 actionable tasks: 3 executed, 33 up-to-date
(node:17264) UnhandledPromiseRejectionWarning: Error: 
/home/michi/software/workspace/web-client-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformDexWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: 
java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define 
Lcom/google/android/gms/actions/ItemListIntents;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
     at ChildProcess.whenDone 
(/home/michi/software/workspace/web-client-ionic/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
     at emitTwo (events.js:126:13)
     at ChildProcess.emit (events.js:214:7)
     at maybeClose (internal/child_process.js:925:16)
     at Socket.stream.socket.on (internal/child_process.js:346:11)
     at emitOne (events.js:116:13)
     at Socket.emit (events.js:211:7)
     at Pipe._handle.close [as _onclose] (net.js:567:12)
(node:17264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing 
inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). 
(rejection id: 1)
(node:17264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise 
rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My ionic info:

cli packages: (/usr/lib/node_modules)
   @ionic/cli-utils  : 2.0.0-rc.0
   ionic (Ionic CLI) : 4.0.0-rc.0

global packages:
   cordova (Cordova CLI) : 8.0.0 

local packages:
   @ionic/app-scripts : 3.1.8
   Cordova Platforms  : android 6.4.0
   Ionic Framework    : ionic-angular 3.9.2

System:
   Android SDK Tools : 26.1.1
   NodeJS            : v8.10.0
   npm               : 5.7.1 
   OS                : Linux 4.13

Environment Variables:
   ANDROID_HOME : /abc/android/sdk

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用 Ionic CLI 4.0.0-rc.0 和列出的 Cordova Android 環境重現命令 ionic cordova build android --release,然後將其與 @latest 比較;檢查與回報的重複類別 com/google/android/gms/actions/ItemListIntents 相關的 release 建置相依性輸入。完成的標準是 release 建置在沒有重複類別失敗的情況下完成,且該回歸已被涵蓋或獲得解釋。

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

評估

技術堆疊
android, typescript
領域
build-system, cli, mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
20/100

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

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