解决Android Studio导入中文路径项目问题

Keva
阅读 1,897

今天用android studio导入项目,一直报错,错误如下:

Your project path contains non-ASCII characters. 

Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by using the command line flag -Dcom.android.build.gradle.overridePathCheck=true, or adding the line com.android.build.gradle.overridePathCheck=true' to gradle.properties file in the project directory. 

方案一:

就是让项目导入的路径不要存在中文,把中文目录名换成英文的就可以了,重新启动项目

方案二:

1、找到 C\Users\用户名\.gradle目录下的gradle.properties,如果该文件不存在则创建。

2、在gradle.properties中添加如下设置:

com.android.build.gradle.overridePathCheck=true

重新启动工程即可。

回到顶部