2017-09-26 87 views
3

我想將我的VR項目編譯爲android手機。無法編譯爲Android(Unity)

但是我不斷收到以下錯誤:

Failed to compile resources with the following parameters: 
-bootclasspath "C:/Program Files (x86)/Android/android-sdk\platforms\android-26\android.jar" -d "C:\Users\**\Documents\**\**\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\google\gvr\keyboardsupport\R.java" "com\google\gvr\permissionsupport\R.java" "com\google\vr\cardboard\R.java" "com\google\vr\keyboard\R.java" "com\***\**\R.java" "com\unity3d\unitygvr\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. 

我已經安裝Android Studio &的Android SDK我也安裝了Java SDK的最新版本

誰能告訴我,我能做些什麼?

更多errrors:

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:263) 
UnityEditor.HostView:OnGUI() 

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:263) 
UnityEditor.HostView:OnGUI() 
+0

您是否收到任何實際的錯誤?這些警告不應該導致編譯過程自行失敗。你的Gradle構建文件是什麼樣的? – Ewald

+0

這可能是你的問題嗎? http://answers.unity3d.com/questions/1315550/compiler-issue-building-to-android.html – AVAVT

+0

@Ewald ive添加更多錯誤消息 –

回答

4

我認爲這是由於JDK 9.我看到我家的電腦,在那裏我有JDK 9.我不上這個同樣的錯誤導致t請參見JDK 8在工作中的錯誤(具體而言,我使用的是JDK 8 Update 131,64位。)

如果我正確讀取錯誤消息,它看起來像是在統一或Android工具鏈中請求源f編譯針對Java 6.0(1.6)。大約11歲,因此在JDK 9中被標記爲已棄用。降級到JDK 8應該暫時解決此問題。最終,該工具鏈將需要更新以支持新版本。