aapt.exe crash CommandInvokationFailure: Failed to re-package resources

When I build and empty scene on Android I get this error. I tried to execute the comand on comand line inside temp folder

C:\SDKAndroid\build-tools\24.0.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “C:/SDKAndroid\platforms\android-24\android.jar” -F bin/resources.ap_

And aapt.exe ALWAYS crash after the line “Processing image: res\drawable\app_icon.png”

I tried everything, I read tons of articles in this formun, android forums and nothings helps.

I’m using

  • Unity 5.3.5f1 Personal 64 bits
  • Windows 10
  • Android Studio
  • Android SDK 24

Here’s the complete aapt.exe output:

C:\SDKAndroid\build-tools\24.0.0\aapt.exe package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/SDKAndroid\platforms\android-24\android.jar" -F bin/resources.ap_

Configurations:
 (default)
 v14
 v21
 xhdpi-v4

Files:
  drawable\app_icon.png
    Src: () res\drawable\app_icon.png
    Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
  values\strings.xml
    Src: () res\values\strings.xml
  values\styles.xml
    Src: () res\values\styles.xml
    Src: (v14) res\values-v14\styles.xml
    Src: (v21) res\values-v21\styles.xml
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
  Type drawable
    drawable\app_icon.png
      Src: () res\drawable\app_icon.png
      Src: (xhdpi-v4) res\drawable-xhdpi\app_icon.png
  Type values
    values\strings.xml
      Src: () res\values\strings.xml
    values\styles.xml
      Src: () res\values\styles.xml
      Src: (v14) res\values-v14\styles.xml
      Src: (v21) res\values-v21\styles.xml
Including resources from package: C:\SDKAndroid\platforms\android-24\android.jar

applyFileOverlay for drawable

applyFileOverlay for layout

applyFileOverlay for anim

applyFileOverlay for animator

applyFileOverlay for interpolator

applyFileOverlay for transition

applyFileOverlay for xml

applyFileOverlay for raw

applyFileOverlay for color

applyFileOverlay for menu

applyFileOverlay for mipmap

Processing image: res\drawable\app_icon.png

1 Answer

1

I got the same problem today, even with a new, clean project. It seems to be a problem with aapt tool from the newest Android SDK Build Tools. I’ve downgraded my build tools form 24 to 23.0.3 and it works (I’m using SDK 23 with Android Studio on Win10).