ionic + cordova 配置和开发过程中的一些问题
1、Android sdk:ERROR: SWT folder '' does not exist.问题
在win x86系统中,如果运行Android的 sdk manager,会出现Android sdk:ERROR: SWT folder '' does not exist.问题,此sdk是google官网下的android-studio-bundle-135.1629389.exe安装后的原sdk,
需要找到安装后的sdk文件夹下的tools\lib\find_java.bat文件,找到第27行
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
改为
find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
即把32后面的空格去掉
这样就能正确的定位到find_java32.exe而不是find_java32 .exe
来找匹配的Java.exe
2、ionic build android 错误:Could not resolve all dependencies for configuration
在Android Studio中执行 gradle clean或者编译项目的时候,会报如下的错误:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:appcompat-v7:22.2.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.jar
file:/D:/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.pom
file:/D:/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.jar
file:/D:/android-sdk/extras/google/m2repository/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.pom
file:/D:/android-sdk/extras/google/m2repository/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1.jar
Required by:
voicedemo:app:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
解决方法:是在Android Studio中依次点击Tools -> Android -> Android SDK Manager,在"Extras"选项下更新如下两个文件即可。
Android Support Repository , Android Support Library