Unity,无法构建资源

时间:2017-10-26 10:01:42

标签: android unity3d build google-play-games

我使用的是Windows 10,统一2017.2.03f,GooglePlayGamesPlugin-0.9.41。我试图解决这个问题,但我完全失败了。一切都很好,直到我安装playgames插件。我已经尝试了来自这里和团结社区网站的多种解决方案而没有运气。他们修复了这些错误但创建了其他错误导致仍然无法构建。我们将非常感谢您对解决方案的任何帮助,感谢您的时间和对不起,如果这是一个愚蠢的问题。 :)

错误1:

$N = 1
foreach($Picture in (get-childitem 'D:\test')){
    Rename-Item $Picture.FullName -NewName ($Picture.Name -replace " .*(\..*)","_$N`$1")
    $N++
}

错误2:

Failed to compile resources with the following parameters:
-bootclasspath "C:/Android/sdk\platforms\android-25\android.jar" -d "C:\Users\Galatia420\Documents\My Games\Abby's In Space\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "android\support\compat\R.java" "android\support\coreui\R.java" "android\support\coreutils\R.java" "android\support\fragment\R.java" "android\support\mediacompat\R.java" "android\support\v4\R.java" "com\Galatia420Games\AbbyChroniclesAbbysInSpace\R.java" "com\google\android\gms\R.java" "com\google\android\gms\auth\R.java" "com\google\android\gms\auth\api\R.java" "com\google\android\gms\base\R.java" "com\google\android\gms\drive\R.java" "com\google\android\gms\games\R.java" "com\google\android\gms\nearby\R.java" "com\google\android\gms\tasks\R.java" "com\google\example\games\mainlibproj\R.java" "com\google\games\bridge\R.java"
warning: [options] source value 1.6 is obsolete and will be removed in a future release
warning: [options] target value 1.6 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

错误3:

构建播放器时出错:3个错误

错误4:

构建已完成,但结果为“失败”' UnityEngine.GUIUtility:ProcessEvent(Int32,IntPtr)

错误5:

UnityException: Resource compilation failed!
Failed to recompile android resource files. See the Console for details.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex)
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message)
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String title, System.String message)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:271)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

4 个答案:

答案 0 :(得分:1)

对于任何发现此问题且遇到类似问题的人,我发现答案是JDK 9和统一的问题。在尝试了其他一切后,我降级为jdk-8u152并解决了问题。

答案 1 :(得分:0)

我使用jdk 8u152和unity 2017.2并且问题仍然存在...当我选择“auto graphics api”时,问题出现了,删除了勾选并选择了你想要使用的图形api,错误就会消失; )

答案 2 :(得分:0)

如果有人到目前为止仍然存在错误,那么您可以按照以下步骤执行此操作:

首先,转到

  

档案 - >构建设置或CTRL + SHIFT + B

并更改此

build system gradle

build system internal

它将按预期构建。

注意:您必须安装Android Studio才能使用此功能。

答案 3 :(得分:0)

当编译器与项目中的插件冲突时,会发生此问题。 打开 /资产/插件,查看是否存在重复或不同版本的.jar文件。