CommandInvokationFailure: Failed to re-package resources
I've just recently began development for the Gear VR on Unity 5, and after creating my scene, which is just a basic room with the cameras, I get the error "Failed to re-package resources". I tried some of the methods listed in other threads here, but to no avail. Any help would be appreciated. Here's the error codes:
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\XXX\AppData\Local\Android\sdk\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/XXX/AppData/Local/Android/sdk\platforms\android-21\android.jar" -F bin/resources.ap_ --extra-packages com.oculus.Integration -S "C:\Users\Public\Documents\Unity Projects\New Unity Project\Temp\StagingArea\android-libraries\ovrplugin\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\XXX\AppData\Local\Android\sdk\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/XXX/AppData/Local/Android/sdk\platforms\android-21\android.jar" -F bin/resources.ap_ --extra-packages com.oculus.Integration -S "C:\Users\Public\Documents\Unity Projects\New Unity Project\Temp\StagingArea\android-libraries\ovrplugin\res"
stderr[
]
stdout[
]
No, that doesn't seem to be the same problem.... See the same problem below :-)
Answer by jk34594345 · Mar 17, 2016 at 04:22 PM
I got the same error. What it looks like is that Unity does not work well with the version "24.0.0-preview" of the Android SDK build tools.
Solution: 1.) Quit unity 2.) Make sure you have e.g. the version "23.0.0" of the Android build tools installed. 3.) Find the folder called "24.0.0-preview" in your android SDK and delete it. ( Or move it somewhere else to copy it back again once you're "done" with your unity dev'ing and maybe want to use the latest Android SDK for other stuff. 4.) Restart unity, exporting.
This worked for me. It's not a great solution, because you basically can't use the latest Android SDK version...
I tried to find a place "in unity" where one could configure which SDK version to use, but couldn't find that.
I haven't filed a bug report yet, but maybe that'd be a good idea...
I was having the same problem with 24.0.0, but not 24.0.0-preview. Nevertheless, this solution solved the issue for me by reverting to 23.0.3.
Answer by NeoToriyama · Mar 17, 2016 at 07:56 PM
Thank you! It actually worked! Now. I can build my apks out, I really appreciate this, gonna get me on the way to developing my own apps! Thanks again!
Answer by pixity71 · Jun 16, 2016 at 07:39 PM
Worked for me!! Unity 5.3.5 and deleted at this location C:\Users[user]\AppData\Local\Android\sdk\build-tools
Answer by zakirshikhli · Jun 17, 2016 at 05:24 PM
After updating Unity to 5.3.5 I installed back all SDK versions till API 24 and 23 preview, NO ERRORS. Thanks to Unity team for useful update.
Answer by parjanyaroy · Jul 09, 2016 at 06:56 AM
Worked like a charm !! :D ... And I was stuck with updating sdk , creating version.xml , replacing aapt.exe for the last week . wish I had found this thread sooner . Thnx ..
Your answer
Follow this Question
Related Questions
How Can I Reset Values?(Unity3D) 0 Answers
how can i add items into the game without having to put them all on the scene 1 Answer
How to make an object follow along the terrain? 0 Answers
Player cannot stop moving after key released! 2 Answers
Adjust the size of the object within a parent container 0 Answers