Unity Daydream APK构建失败

时间:2018-12-17 06:46:52

标签: java android unity3d gradle

我无法使用Unity 2018.2.17f1来构建GoogleVRForUnity.unitypackage项目。当我尝试构建时,出现错误消息:

files
    .reduce(function (acc, file) {
        return acc.then(function () { return uploadImageAsPromise(file); });
    }, Promise.resolve())
    .then(function () { console.log('All done!'); });

这另外2个错误:

CommandInvokationFailure: Gradle build failed. 
C:/Program Files/Java/jdk1.8.0_191\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

 stderr[

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\samu-\Desktop\Capacitaci�n �xito - copia\Temp\gradleOut\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> 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.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s
]
stdout[
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Download https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

并且:

Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

如果有人知道发生了什么,我将很乐意为您解决这个问题

1 个答案:

答案 0 :(得分:0)

  
      
  • 其中:构建文件'C:\ Users \ samu- \ Desktop \ Capacitaci.n xito-copia \ Temp \ gradleOut \ build.gradle'行:22

  •   
  • 出了什么问题:评估根项目“ gradleOut”时出现问题。

         
        

    无法应用插件[id'com.android.application']您的项目路径包含非ASCII字符。这很可能     导致构建在Windows上失败。请将您的项目移至     不同的目录。有关详情,请参见http://b.android.com/95744。这个     可以通过添加以下行来禁用警告     'android.overridePathCheck = true'到gradle.properties文件中     项目目录。

      
  •   

如果您仔细观察这行“ C:\ Users \ samu- \ Desktop \ Capacitaci.n xito-copia \ Temp \ gradleOut \ build.gradle”,则您的路径中包含ASCII符号,使它在构建时失败。

更改路径或将其命名为没有ASCII的名称,然后尝试重建它。似乎它无法解密ASCII字符并引发错误。确保仅在构建路径中使用英文字符。

这是link中提到的引号,您的错误内容如下:

  

要进一步扩展先前的答案:Java启动器未使用支持Unicode的Windows API(宽字符),因此命令行参数会进行有损转换。看一下“réseaux”这个名字会发生什么:   -é是U + 00E9(带有小写字母的拉丁小写字母e),其UTF-8编码为“ c3 a9”   -不知道此编码的Java启动器(在dx中)会将其解释为两个字节,其中Ã是c3,©是a9(在Latin-1中是合理的),结果为“réseaux”。


请检查此可能的重复项,以获取更多information