用的是mac系统做的开发,以下是在日常开发中遇到的一些错误。
一、
说明:出现有这个错误的原因远不止截图所示,这里只是提示一下有这种可能。
es5跟es6在使用语法上有一定的区别,这里就是因为在用es6创建的类中,用了es5,所以识别不了。


解决方法:统一使用同一种语法。
二、报错信息提示:需要一些之元素,我这里出错是因为我使用了tabBar,然后没有给tabBar指定需要显示的内容。


解决方法:如图所示,给每个tabBar指定了要显示的View,这相当于iOS中的ViewController
三、这个错误是在android模拟器上运行出错的。

出错原因:因为android上的图片的png格式审查不通过的。
解决办法:在android的app的如下文件中,加上这两句话,然后重启项目。

四、我们在写代码的时候出现如下错误:

原因:应用变量的时候,要加上{}
解决办法:

五、启动android模拟器出错

报错信息提示:没有找到android device,但是我明明已经启动模拟器了。
原因:sdk路径不对。
解决办法:1.先关掉模拟器
2.然后设置如图

3.重新开启模拟器。
这里注意一下:如果你本来的设置就是像截图一样的,那么你可以尝试:1.关掉模拟器 2。选择第一个:user Genymotion Android tools(default) 3.重新开启模拟器
网友评论