- Home /
Google Cardboard build error
I keep getting the "Failed to re-package resources. See the Console for details." error even though it builds properly when run in Unity. But when I try to run my game on an actual Android device it fails with the error message.
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\<name>\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/<name>/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.BuildPlayerWindow:BuildPlayerAndRun()
Now I have no idea where exactly the problem even happens, other than that it happens at the repackaging process. I'm only using the Google Cardboard SDK and my own created assets.
Unity version is 5.3.5f1. I think this happened after I updated Android Studio since I think they may be sharing some files.
To add, it does not matter whether there is code or not in this project. It seems to be a problem with Unity itself. Pasted is the error I get (main folder names withheld). OS is Windows 10 (upgraded from Windows 7).
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\<name>\AppData\Local\Android\sdk\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -$$anonymous$$ Android$$anonymous$$anifest.xml -S "res" -I "C:/Users/<name>/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 error$$anonymous$$sg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String error$$anonymous$$sg)
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()
you should install a newer version of the android build tools. there was an issue with 24.0.0 if i recall.
Your answer
![](https://koobas.hobune.stream/wayback/20220612093007im_/https://answers.unity.com/themes/thub/images/avi.jpg)