Unity 5错误:无法重新打包资源

时间:2016-07-09 18:00:25

标签: c# android android-studio unity3d

当我尝试在Unity中构建任何Android项目时,我收到了以下错误:

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\alexi\AppData\Local\Android\sdk\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/alexi/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_

stderr[

]
stdout[

]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
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.HostView:OnGUI()

这个错误:

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\alexi\AppData\Local\Android\sdk\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/alexi/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_

stderr[

]
stdout[

]

我在Android SDK中安装了这些软件包: link here

1 个答案:

答案 0 :(得分:1)

我刚修好了。由于某些原因,安装了Android SDK Build-Tools 24导致了这个问题。我卸载了使用Android ADK Manager(安装了Android SDK Build-Tools 23.0.3),它解决了这个问题。