一、但是编译运行到手机端,会有许多新问题:
很尴尬,要这样:ionic start UDahuo.App sidemenu --no-git --skip-deps
具体参考:http://www.cnblogs.com/ejiyuan/p/6285762.html
二、ionic serve又出错:
参考:http://www.cnblogs.com/newljc/p/5684223.html
三、cordova build android报错Exception in thread "main" java.lang.RuntimeException: java.net.SocketException:
解决:
1、gradle-3.3-all.zip下载缓慢可自己手动下载
http://services.gradle.org/distributions/
2、放到项目这个目录下myApp\platforms\android\gradle\gradle-3.3-all.zip
3、找到这个文件
myApp/platforms/android/cordova/lib/builders/GradleBuilder.js
4、202行改为这个
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || '../gradle-3.3-all.zip';
5、ok,运行cordova build android;
注意:不要下载4.1版本,我一开始就是下载最新的,报错:
` What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugApk'.
A problem occurred configuring project ':CordovaLib'.
Failed to notify project evaluation listener.
com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
`
换了版本就好了,难受!