2016-08-11 53 views
0

我在Unity項目中添加了Fabric和Crashlytics,並且正在嘗試爲Android構建。我得到的消息是:Android版建設問題

Failed to compile resources with the following parameters: 
-bootclasspath "/Users/mihai.stan/Library/Android/sdk/platforms/android-24/android.jar" -d "/Users/mihai.stan/Dev/SideScroller/Temp/StagingArea/bin/classes" -source 1.6 -target 1.6 -encoding UTF-8 "com/tagonsoft/spaceattack/R.java" "io/fabric/answers/android/unity/R.java" "io/fabric/beta/android/unity/R.java" "io/fabric/crashlytics/android/unity/R.java" "io/fabric/sdk/android/unity/R.java" "io/fabric/unity/android/R.java" "io/fabric/unity/crashlytics/android/R.java" 
warning: /Users/mihai.stan/Library/Android/sdk/platforms/android-24/android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler. 
    It is recommended that the compiler be upgraded. 
warning: /Users/mihai.stan/Library/Android/sdk/platforms/android-24/android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler. 
    It is recommended that the compiler be upgraded. 
2 warnings 

UnityEditor.HostView:OnGUI() 

UnityException: Resource compilation failed! 
    Failed to recompile android resource files. See the Console for details. 
    UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message, System.Exception ex) 
    UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message) 
    UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries) 
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) 
    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.Android.AndroidBuild 

Postprocessor.PostProcess (BuildPostProcessArgs args) 
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316) 
UnityEditor.HostView:OnGUI() 

Error building Player: UnityException: Resource compilation failed! 
Failed to recompile android resource files. See the Console for details. 

請記住,我已經更新了兩個截拳道和JRE和Android工作室。 有關如何修復它的任何提示?

+0

爲什麼不找出造成問題的原因?你可以通過創建一個新項目然後嘗試構建它來做到這一點。如果可行,請逐個添加插件,並查看哪一個阻止Unity爲Android構建。 – Programmer

+0

對不起,遲到的迴應。試圖建立一個空的項目,沒有織物,工作。嘗試使用Fabric和Crashlytics,失敗,與發佈的錯誤相同。 –

回答

0

我設法解決它。我已更新jdk,但Unity未能自動檢測到新路徑,因此我必須手動完成。一切都按預期運作。