ionic3 创建 ionic1项目

正常创建ionic项目

如果你打开了这篇文章,意味着你起码已经知道正常创建ionic项目的步骤了
就像这样   ionic start myApp tabs
然后如果你想创建一个 Android 应用的话,再执行下面的代码
cd myApp
ionic platform add android
ionic build android
ionic emulate android
但是在 ionic3 里面这样是不行的

ionic3 下创建 ionic1 的项目

首先我们先创建一个项目,它的语法是这样的
ionic start app tabs --type=ionic1
如下图所示

创建项目

然后添加平台,注意看下图,我们先尝试下
ionic platform add android
报错了,运行不下去了,看看蓝框内的提示,我们试试这种写法
ionic cordova platform add android
嗯,成功了

添加平台

然后开始第三步吧,ionic build android,好像又出问题了
看看提示,它说 perhaps you meant ionic cordova build android?,没错,我就是这个意思
敲一下ionic cordova build android,下面一串看起来不像成功的样子
好吧,照着提示试试这句呢cordova build android,成了

build

漫长的下载过程,,,等待过程中顺便写了这篇笔记,等待之后迎来了报错

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/
4.1/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.

* Get more help at https://help.gradle.org
(node:9352) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): 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/
4.1/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.

* Get more help at https://help.gradle.org
(node:9352) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

报错了

在网上找了很久的解决方法,终于找到了这里,解决方法如下
解决方法

好吧,我们尝试一下
解决方法

然后打开命令行,这一句ionic cordova build android现在可以用了,弹出了好多下载信息,结局也是很令人欣慰的
成功了

来运行下试试,不出所料ionic emulate android这一句是不行的

运行

根据提示,我们运行ionic cordova emulate android这一句,成功了
成功了

打开虚拟机,看着成功的界面,感动的冒泡
感动的冒泡

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 目录 说明 环境搭建 起始一个ionic项目 angular(操作数据)在项目中常用到的点,以及与jq(操作dom...
    新林吃遍世界阅读 1,519评论 0 0
  • 基于ionic2的跨平台项目(iOS) 一、技术背景 为了开发html5,除了最新使用React Native等之...
    庆华_8f67阅读 1,539评论 1 3
  • 大四,我们面临毕业,我一直忙于班级毕业旅行的事情,很少顾及到她的感受。本来打算我们一起跟班级旅行的,可是她需要做一...
    骑车去旅行阅读 230评论 0 1
  • 翻微博翻到超话,下拉找自己男神的排名,无意中翻到了Kim的,翻看VIP们写的帖子,再看今天的日期,快一周年了...
    穷开xing阅读 222评论 0 1

友情链接更多精彩内容