Skip to content

Instantly share code, notes, and snippets.

@ksc91u
Last active February 19, 2018 10:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksc91u/f167a7d56e0c2646c9c8 to your computer and use it in GitHub Desktop.
Save ksc91u/f167a7d56e0c2646c9c8 to your computer and use it in GitHub Desktop.
aapt malformed 9 patch image
#!/bin/bash
enable pwd
args=("$@")
DIR="$(cd "$(dirname "$0")" && pwd)"
case "${args[@]}" in
*".9.png"*)
$DIR/aapt.17 $@
;;
*)
$DIR/aapt.20 $@
;;
esac
@azizove
Copy link

azizove commented Jan 22, 2015

how to integrate it in an android project?

@lucifer662607004
Copy link

May I ask the same question?

@ksc91u
Copy link
Author

ksc91u commented Jul 17, 2015

https://gist.github.com/ksc91u/37513796b2cec37bb3c5

See the comments in this gist to find locations to put this file.

  1. Rename aapt to aapt.20
  2. Copy aapt from tools version 17 to aapt.17
  3. Put this gist as aapt chmod +x

@4bd03cs006
Copy link

java.io.IOException: Cannot run program "C:\Users\ankit\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe": CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:167)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:117)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:205)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running.

I am getting above error, it's really helpful.. if u can solve my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment