CommandInvokationFailure when building for Android
Hey Unity Answer peeps,
I'm trying to create a android build of my project But during Packaging Resources i get two kind of errors.
A bit of info: I've installed both android studio and JDK 64bit (with Android 6.0 (Marshmallow) ) The project has no Plugins. I've restarted my PC after installing android studio and JDK.
I've searched Unity Answers for my problem but most of them were talking about plugins and androidmanifests file. which i don't have. and i don't have a clue what these errors mean.
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\Kevin Breurken\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/Kevin Breurken/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()
and this one :
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\Kevin Breurken\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/Kevin Breurken/AppData/Local/Android/Sdk\platforms\android-24\android.jar" -F bin/resources.ap_
stderr[
]
stdout[
]
I am having the same trouble as well.. Hopefully we have a solution soon.
I haven't found the issue yet. But i'm gonna reinstall both JD$$anonymous$$ and Android Studio today. Hopefully i'll get better results.
Answer by zakirshikhli · Jun 18, 2016 at 04:02 PM
I fixed this issue by uninstalling 24 and 23 preview SDK's from Android Standalone SDK manager. But I guess in latest Unity (5.3.5) this error must not be happened, even with latest SDK's installed.
Allright i finally got it to work. But i've done multiple things so i'll post them here for people who will find this later:
i followed your tips zakirshikhli:
I used 5.3.5 Unity.
I used Android build tools version 23
I used SD$$anonymous$$ version 23.
I also changed my SD$$anonymous$$ location to a location outside of my user folder (it had whitespaces and Android Studio said it didn't like that. ) And i removed the other SD$$anonymous$$'s manualy.
Thank you zakirshikhli for your reply. Now i can continue deving!
Your answer
Follow this Question
Related Questions
Unity 5 Android Build Failure - No Plugins 2 Answers
Unable to convert classes into dex format 2 Answers
Unity says that I'm missing my NDK and SDK libraries, but I have them installed via Unity hub? 1 Answer
Input falsely recognized on a Samsung Galaxy Tab A7 0 Answers
Android Resolve takes too long (hours!) 2 Answers