我正在尝试构建我的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
,因为它在这里说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 FilesJavajdk1.7.0_79binjava.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:PATHappplatformsandroidgradlew
cdvBuildRelease -b C:PATHappplatformsandroidbuild.gradle
-Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"
有人能帮我处理一下吗?
尝试运行以下命令
ionic build android --release
如果运行ionic run android
后没有显示错误,您应该在此文件夹中找到.apk
:
MyAppplatformsandroidbuildoutputsapk