android studio使用中遇到的问题

1.从SVN上导入一个新项目,第一次building的时候时间很长。

  

使用该设置时,加载的gradle wrapper为项目中\gradle\wrapper\gradle-wrapper.properties里设置的版本,例如,我所同步的项目的该文件的内容为:

win8系统下,打开C:\Users\用户名\.gradle\wrapper\dists\gradle-2.14.1-all,里面有一个文件夹8bnwg5hd3w55iofp58khbp6yv,点击进去,里面有两个文件

这两个文件一定不能删除。接着从网上下载一个gradle-2.14.1-all.zip拷贝到该目录下(注意,压缩包命名一定要与gradle-wrapper.properties里的一致),解压,然后重新打开android studio,就可以很快的building完成。

 

2.导入一个新项目时,出现错误 :SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

   解决方法1:在项目根目录下新建一个文件local.properties,指定sdk的路径,例如SDK路径为D\:\\adt-bundle-windows-x86_64_with_Android_5.0\\sdk时:

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=D\:\\adt-bundle-windows-x86_64_with_Android_5.0\\sdk

然后,重试即可。

解决方法2:关闭,然后再重新打开该项目,会自动添加该文件。^……^

posted @ 2017-07-12 16:01  苏小七  阅读(546)  评论(0编辑  收藏  举报