ionic2rc版常见的一些坑

时间:2023-03-09 02:30:30
ionic2rc版常见的一些坑

1、config.xml里的包名不能有横杠,否则在build android的时候会报错

<widget id="com.ionicframework.name-abc" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
应改为:
<widget id="com.ionicframework.nameAbc" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

2、不建议在src/app的目录里添加其他ts文件,否则在build android的时候会报错

bundle failed: Could not resolve 'xxx.ts' from **/app.module.js

3、不建议多个页面文件共用一个文件夹,在ionic build android的时候会出现跟上面一样的错误。

pages
--home
----home.html
----home.scss
----home.ts
----home-details.html
----home-details.scss
----home-details.ts

4、在rc版使用Pipe后 ,build android报错。

常规写法:{{ item.state | pipeName }}

Supplied parameters do not match any signature of call target. 意思是找不到匹配跟目标的方法签名。

rc正确写法:{{item.state | pipeName : item.state}}

未解决:

1. 快速点击返回按钮时会出现黑屏,issue地址:https://github.com/driftyco/ionic/issues/8881 。

2. 将mode设置成ios后,在android平台ion-list ion-item项没有分割线,issue地址:https://github.com/driftyco/ionic/issues/5109。

3. ionic resources 不能正常生成图标 ,issue地址:https://github.com/driftyco/ionic-cli/issues/1166 。

持续更新。。。