我正在尝试使用tutorial构建“我的第一个应用程序”,我也尝试使用another tutorial for version 1.2为android构建,但每次我得到相同的错误“无法重新编译android资源文件”。在控制台中,我看到了
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\User\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/User/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_ --extra-packages eu.kudan.androidar -S "C:\Users\User\Documents\MyFirstKudanApp\Temp\StagingArea\android-libraries\KudanPlugin\res"
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\User\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/User/AppData/Local/Android/sdk\platforms\android-24\android.jar" -F bin/resources.ap_ --extra-packages eu.kudan.androidar -S "C:\Users\User\Documents\MyFirstKudanApp\Temp\StagingArea\android-libraries\KudanPlugin\res"
stderr[
]
stdout[
]
我做错了什么?
答案 0 :(得分:4)
只是因为我所做的工作对我而言,我会把这个问题扔给那些可能遇到这个问题的人。我正在尝试为Nougat构建,我在Android SDK文件夹中甚至没有24
构建工具。
我安装了JDK 1.7.0_79以及JSD 1.8.0_101。看起来Unity试图使用1.7版本。我在 Unity - >中切换到使用1.8偏好 - >外部工具 - > JDK 这最终为我编译了一切。
答案 1 :(得分:3)
可能是由于您使用的24.0.0构建工具中的错误。尝试从SDK管理器中删除24.0.0 build tools文件夹并重新启动Unity。这里有一个类似问题的post。
答案 2 :(得分:1)