unity2019中文路径打包安卓失败问题(Your project path contains non-ASCII characters)

unity2019打包安卓出现Gradle build failed.

看日志显示

* What went wrong:
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin [id 'com.android.application']
   > 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 adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

日志提示错误原因是因为项目路径non-ASCII characters,是因为我路径有中文的原因,移出到非中文路径也是可以解决的,但是日志也里提示了其他的解决办法。
其中有一句为:

his warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

意思是可以在 gradle.properties中添加’android.overridePathCheck=true’来解决这个问题。

在 gradle.properties中添加’android.overridePathCheck=true’

一、设置自定义gradle.properties

Project Setting —> Player —> Publishing Settings —> Custom Gradle Properties Template 勾选上,自动生成gradleTemplate.properties文件,下方提示路径在Assets\Plugins\Android下
在这里插入图片描述

二、添加’android.overridePathCheck=true’

打开gradleTemplate.properties编辑,添加’android.overridePathCheck=true’保存。
在这里插入图片描述

三、返回直接打包,成功。

猜你喜欢

转载自blog.csdn.net/qq_27050589/article/details/124978028