【问题标题】:Issue with building for Android为 Android 构建问题
【发布时间】:2016-08-11 13:06:52
【问题描述】:

我在我的 Unity 项目中加入了 Fabric 和 Crashlytics,我正在尝试为 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.

请记住,我已经更新了 jkd 和 jre 以及 Android Studio。 有关如何修复它的任何提示?

【问题讨论】:

  • 为什么不找出导致问题的原因?您可以通过创建一个新项目然后尝试构建它来做到这一点。如果可行,请一一添加插件,看看哪个会阻止 Unity 为 Android 构建。
  • 抱歉回复晚了。尝试构建一个没有织物的空项目,工作。尝试使用 Fabric 和 Crashlytics,失败,与发布的错误相同。

标签: java android unity3d


【解决方案1】:

我设法修复它。我已经更新了 jdk,但是 Unity 无法自动检测到新路径,所以我必须手动完成。现在一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-17
    • 2014-09-01
    • 2016-10-09
    • 1970-01-01
    • 2015-01-22
    • 2015-09-11
    • 2014-11-13
    • 1970-01-01
    相关资源
    最近更新 更多