一、在安装AndroidStudio之前请确保你已经安装了jdk并配置了环境变量
软件下载地址及安装方法:http://developer.android.com/sdk/installing/studio.html
二、安装完了打不开,解决方法参考:http://wenku.baidu.com/view/0d42bff6941ea76e58fa04cc.html
三、新建项目时,选择project location时,无法next,把光标定位到Applicatioin name的输入框中,即可,参考:http://blog.csdn.net/xuqingfeng77/article/details/8938317。
但是,最后弹出Resolve error窗口,并显示:
Failed to import new Gradle project: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
java.net.UnknownHostException: services.gradle.org
services.gradle.org
Consult IDE log for more details (Help | Show Log)
解决办法:
1.http://services.gradle.org/distributions/gradle-1.6-bin.zip 手动去下载,下载完之后,解压到任何位置,在环境变量的path配置到gradle的bin目录即可。配置好环境变量之后,在cmd中用gradle -v命令验证是否成功
2.关闭AndroidStudio,重新打开AndroidStudio新建项目
结果又弹出Resolve error窗口,并显示
Failed to import new Gradle project: Could not fetch model of type 'IdeaProject' using Gradle installation 'D:\Program Files\gradle-1.6'.
A problem occurred configuring project ':test_wifi_socket'.
A problem occurred configuring project ':test_wifi_socket'.
Could not resolve all dependencies for configuration ':test_wifi_socket:classpath'.
Could not resolve com.android.tools.build:gradle:0.4.
Required by:
Test_collections:test_wifi_socket:unspecified
Could not GET 'http://repo1.maven.org/maven2/com/android/tools/build/gradle/0.4/gradle-0.4.pom'.
repo1.maven.org
Consult IDE log for more details (Help | Show Log)
解决办法:
1 定位到目录 C:\Users\<username>\.gradle
2 创建文件gradle.properties
内容:org.gradle.jvmargs=-Xmx512m
3 重启你的Android Studio项目,搞定。
四、整合原来eclipse上的安卓项目:
从Eclipse中导出
1.升级Eclipse Adt plugin(至少升级到v22.0),升级方法:Help->Check For Updates,查看当前ADT版本:Help->About ADT,点击相应的图标即可。
2.eclipse中,File -> Export -> Android -> Generate Gradle build files
3.选择要导入到Android Studio中的项目,该项目仍然在原来的目录下面,但是会多加了个build.gradle文件。
在Android Studio中导入
1.Android Studio中,File -> Import Project
2.选择你的导入的项目路径,选择Create project from existing sources
3.接着就是跟着安装向导一步步往下就行了。
参考:http://developer.android.com/sdk/installing/migrate.html
原文地址:http://blog.csdn.net/bewhatyouare/article/details/9004073