“zipAlignExe' does not exist.” error while run

2020-07-08 06:47发布

I'm getting error below this,

Error:A problem was found with the configuration of task ':project1:zipalignDebug'.
> File 'D:\Program Files\Android Studio\sdk\tools\zipalign.exe' specified for property
'zipAlignExe' does not exist.

I downloaded all packages in sdk, I downloaded twice a packages about zipAlign but it didn't solve my problem.

Please help. Thank you.

5条回答
兄弟一词,经得起流年.
2楼-- · 2020-07-08 07:39

In case you run into the following Gradle build error after updating your Android SDK:

A problem was found with the configuration of task ':MyApp:zipalignRelease'.
File '/home/user/SDKs/android-sdk-linux_x86/tools/zipalign' specified for property 'zipAlignExe' does not exist.

Therefore, I updated the android-sdk-setup script to also symlink zipalign. Gradle now finds what it is looking for. Happy building!

查看更多
萌系小妹纸
3楼-- · 2020-07-08 07:39

I got this error before, here's what I have done

Go to C:\...\Users\your-name\AppData\Local\Android\sdk\build-tools you have to reach up to build tools. than there you will get list of build tools. enter image description here

Here you have to just copy Zipalign.exe from older to newer version .

It worked for me. I used it in BluetoothLegatt sample code.

查看更多
太酷不给撩
4楼-- · 2020-07-08 07:41

In Windows, make sure your ANDROID_HOME is pointing to the right folder. For me it was:

C:\Program Files\adt-bundle-windows-x86_64-20140321

I updated it but I forgot to point to the newer SDK folder:

C:\Program Files\adt-bundle-windows-x86_64-20140702\sdk

Now I'm sure I'm using the last SDK tools for Android.

Ok, now update the gradle script:

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
}

and

android {
    buildToolsVersion "19.1"
查看更多
倾城 Initia
5楼-- · 2020-07-08 07:43

I got the answer here: http://tech.sarathdr.com/questions/question/gradle-is-failing-with-new-android-sdk-versio-zipalign-is-missing

It says: New android sdk version (23) does not contain the file zipalign file. You can download the old version of android sdk and copy zipalign file to the tools folder

查看更多
男人必须洒脱
6楼-- · 2020-07-08 07:45

If you're using Gradle, updating the Gradle plugin from 0.10 to 0.11 worked for me:

buildscript {
    ...

    dependencies {
        ...
        classpath 'com.android.tools.build:gradle:0.11.+'
    }
}
查看更多
登录 后发表回答