标签:自动 groov 一个 exce .com 4.0 failed 传递 strong
一、搭建Android环境
每一步都要配置环境变量,自行百度即可。
步骤一:安装NodeJS
可参考http://blog.csdn.net/u010255310/article/details/52205132
步骤二:安装java的jdk
步骤三:安装Android的SDK
Android Studio 下载:https://developer.android.com/studio/index.html
点击安装,官网有具体安装步骤。
步骤四:安装Apache Ant
不需要安装,只需要把路径添加到环境变量里面。
Apache Ant,是一个将软件编译、测试、部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发。由Apache软件基金会所提供。
步骤五:使用npm命令安装Cordova
npm install -g cordova
步骤六:安装Gradle
cordova在6.4.0(cordova-android在6.1.2)之后,会要求安装Gradle,基于Gradle来编译、打包android。
下载:Gradle:https://gradle.org/releases
安装:http://blog.csdn.net/maosidiaoxian/article/details/40109337
步骤七:设置Android模拟器
通过AVD(Android Virtual Device) manager创建安卓模拟器。
二、将网页转换成Android APP
步骤一:创建项目
步骤二:导入网页程序
在第一步中,我在 目录 D:\AndroidStudio\ 下创建了 名为 BuySweat 的Android 项目,将自己写好的网页放在 D:\AndroidStudio\BuySweat\www 目录下,首页文件名必须为 index.html。
步骤三:创建APP
cordova build
出现了bug
D:\AndroidStudio\BuySweat>cordova build ANDROID_HOME=D:\AndroidStudio\SDK JAVA_HOME=D:\java Subproject Path: CordovaLib Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details FAILURE: Build failed with an exception. * What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/ 3.3/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. * What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/ 3.3/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
解决方法:
https://stackoverflow.com/questions/20471311/android-studio-unable-to-start-the-daemon-process
最后在platform/android/ant-build/BuySweat-dubug.apk 生成,发送到手机就可以用了。
html5+CSS3+jquery mobile构造简易WebAPP
标签:自动 groov 一个 exce .com 4.0 failed 传递 strong
原文地址:http://www.cnblogs.com/catherinezyr/p/7452299.html