现象
在Ubuntu下面,在使用Android studio编译一个简单的demo程序的时候,报错信息如下:
:app:zipalignDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:zipalignDebug'.
> A problem occurred starting process 'command '/home/teleepoch3/android_sdk/android-sdk-linux/build-tools/21.1.2/zipalign''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
解决
是因为zipalign文件没有可执行权限,可以通过下面的命令查看,并且修改。
进入zipalign目录执行如下命令:
tel@tPC:~/android_sdk/android-sdk-linux/build-tools/21.1.2$ ll zipalign
-rw-r--r-- 1 tel tel 98040 12月 23 2014 zipalign
tel@tPC:~/android_sdk/android-sdk-linux/build-tools/21.1.2$ chmod 0755 zipalign
tel@tPC:~/android_sdk/android-sdk-linux/build-tools/21.1.2$ ll zipalign
-rwxr-xr-x 1 teleepoch3 teleepoch3 98040 12月 23 2014 zipalign*
再重新编译即可。