簡體   English   中英

Ionic v2構建應用

[英]Ionic v2 build app

我正在嘗試構建Ionic 2應用程序以獲取.apk,但我不知道我能否以與Ionic 1相同的方式獲得它(我的應用程序實際上是使用Chrome Developper Tools運行的)。

在文檔中: http ://ionicframework.com/docs/v2/getting-started/installation/它說要做ionic run android來構建。我只正確顯示了模擬器,但我的應用程序未在其中運行,我沒有在我的應用文件夾中看不到任何.apk。

我嘗試了Ionic 1的方式, cordova build --release android正如這里cordova build --release android http://ionicframework.com/docs/guide/publishing.html,但是經過許多.jar下載幾分鍾后,我得到了這個錯誤:

 FAILED
 Exception in thread "main"

 FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe''
finished with non-zero exit value 1

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

BUILD FAILED

Total time: 23.223 secs
Error: Error code 1 for command: cmd with args: /s,/c,"C:\PATH\app\platforms\android\gradlew
cdvBuildRelease -b C:\PATH\app\platforms\android\build.gradle 
-Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"

有人可以幫我處理嗎?

預先感謝!

嘗試運行以下命令

ionic build android --release

然后您在MyApp \\ platforms \\ android \\ build \\ outputs \\ apk中獲得apk

如果ionic run android后未顯示任何錯誤,則應在此文件夾中找到.apk

MyApp\\platforms\\android\\build\\outputs\\apk

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM