4

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?

Nosov Pavel
  • 1,571
  • 1
  • 18
  • 34

3 Answers3

4

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.

Ricky Hartmann
  • 891
  • 1
  • 7
  • 20
3

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.

Community
  • 1
  • 1
Charles Li
  • 1,835
  • 3
  • 24
  • 40
  • 1
    You was right! Now it's working! i just delete android-24 folder from C:\Users\User\AppData\Local\Android\sdk\platforms – Nosov Pavel Jun 29 '16 at 23:34
  • I've tried anything plus any of the solutions on this page. It just doesn't work cause now they released v. 25 and JDK 1.9. I'm sick of this disrespectful incompatibility issues that we have to solve by trial and error until the next update messes it up again and brings us back to square one. And they keep on releasing updates without looking into the issues. Dislike me, do whatever you want... – mireazma Oct 05 '17 at 09:09
1

I had the same error message at the first time I used Unity. I tried download the latest Android SDK and latest build tool, but no use. Changing the JDK version solved the problem. enter image description here

Hannah Zhang
  • 489
  • 5
  • 5