Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to recompile android resource file

I'm trying to build "My First App" with that tutorial also i tried to build with another tutorial for version 1.2 for android, but every time i get the same error "Failed to recompile android resource files". In the console i see

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()

and

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[

]

What i'm doing wrong?

like image 990
Nosov Pavel Avatar asked Feb 06 '23 15:02

Nosov Pavel


2 Answers

Only because what I did worked for me, I'm going to throw this up there for anyone who may run into this issue. I was trying to build for Nougat, and I didn't even have the 24 build tools in my Android SDK folder.

I have JDK 1.7.0_79 installed as well as JSD 1.8.0_101. It looks like Unity tried to use the 1.7 version. I switched to use 1.8 in Unity -> Preferences -> External Tools -> JDK and this ended up compiling everything for me.

like image 152
Ricky Hartmann Avatar answered Feb 15 '23 10:02

Ricky Hartmann


It might be due to a bug from 24.0.0 build tools that you are using. Try deleting the 24.0.0 build tools folder from your SDK manager and restart Unity. Here's a post that has similar problems.

like image 43
Charles Li Avatar answered Feb 15 '23 10:02

Charles Li