arcanum_jp’s blog

おっさんの日記

cannot.find.zip.align=The zipalign tool was not found in the SDK.

<

cannot.find.zip.align=The zipalign tool was not found in the SDK.

Please update to the latest SDK and re-export your application
on run zipalign manually

Aligning applications allows Android to use application resources
more efficiently

Android StudioでSigned APK作ろうとしたらこんなん出ました〜〜〜

意訳:
 zipalignツールが見つかんねぇ・・SDKアップデートして手でzipalign しろや!

嫌です。探してみたらzipalign.exeはあるんですよね、、


Zipalignて何すかや?と思って調べたのがこちら・・・

zipalign is an archive alignment tool that provides important optimization to Android application (.apk) files. The purpose is to ensure that all uncompressed data starts with a particular alignment relative to the start of the file. Specifically, it causes all uncompressed data within the .apk, such as images or raw files, to be aligned on 4-byte boundaries. This allows all portions to be accessed directly with mmap() even if they contain binary data with alignment restrictions. The benefit is a reduction in the amount of RAM consumed when running the application.

http://developer.android.com/tools/help/zipalign.html

zipalignについては日本語はこちらが分かりやすかった

Androidでは、データが4バイトバウンダリに整列されている時に効率良くそのデータにアクセスする事が出来る。
逆に整列されていない場合、その整理されていないデータを正しく読むために遅くなり、また多くのメモリを消費するようになる。

http://qiita.com/kazuqqfp/items/8eae69e309c6ed75d661

ということでインターネットの海を泳いではじめ見つけたのがこちら・・・

最新のADT Tools(v.23)を使用して署名付きビルド(Google Play用ビルド)しようとしたら、上記エラーが出ました。
zipalignコマンドが見つからないようなので、toolsディレクトリに無理やり置きます。
$ cd $ANDROID_HOME

$ cp build-tools/19.1.0/zipalign tools/
# lnだとなぜかダメ。。。

http://qiita.com/shoma2da/items/6d280e0e93c2984bb95b

 それで[zipalign tools]ディレクトリ作ってzipalign.exeをそこにコピーしてやりました。しかし変なダイアログが出てしまいダメでした。でもさっきのエラーメッセージが出ないってことは進展があったんだなと。無理やり思うことにしました。それで見つけたのがこちら。

[Temporary fix]
copy ....android-studio\sdk\build-tools\20.0.0\zipalign.exe to ....android-studio\sdk\tools\

https://github.com/testfairy/testfairy-gradle-plugin/issues/20

こちらだとうまくいきました。しかしなんで今まで出なかったのかね・・build.gradleいじり始めたからかな?

んー、、これでいいのか?これでいいのか?とか思いながらPCをそっと閉じました