简体   繁体   English

在Android Studio上运行我的项目时出现“zipAlignExe'不存在。”错误

[英]“zipAlignExe' does not exist.” error while running my project on Android Studio

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. 我在sdk中下载了所有软件包,我下载了两次关于zipAlign的软件包,但它没有解决我的问题。

Please help. 请帮忙。 Thank you. 谢谢。

If you're using Gradle, updating the Gradle plugin from 0.10 to 0.11 worked for me: 如果您正在使用Gradle,那么将Gradle插件从0.10更新为0.11对我有用:

buildscript {
    ...

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

In case you run into the following Gradle build error after updating your Android SDK: 如果您在更新Android SDK后遇到以下Gradle构建错误:

A problem was found with the configuration of task ':MyApp:zipalignRelease'. 在任务':MyApp:zipalignRelease'的配置中发现了一个问题。
File '/home/user/SDKs/android-sdk-linux_x86/tools/zipalign' specified for property 'zipAlignExe' does not exist. 为属性'zipAlignExe'指定的文件'/ home / user / SDKs / android-sdk-linux_x86 / tools / zipalign'不存在。

Therefore, I updated the android-sdk-setup script to also symlink zipalign . 因此,我将android-sdk-setup脚本更新为symlink zipalign Gradle now finds what it is looking for. Gradle现在可以找到它想要的东西。 Happy building! 快乐的建筑!

I got the answer here: http://tech.sarathdr.com/questions/question/gradle-is-failing-with-new-android-sdk-versio-zipalign-is-missing 我在这里得到了答案: 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. 它说:新的android sdk版本(23)不包含文件zipalign文件。 You can download the old version of android sdk and copy zipalign file to the tools folder 您可以下载旧版本的android sdk并将zipalign文件复制到tools文件夹

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. 转到C:\\...\\Users\\your-name\\AppData\\Local\\Android\\sdk\\build-tools你必须要建立工具。 than there you will get list of build tools. 比那里你会得到构建工具列表。 在此输入图像描述

Here you have to just copy Zipalign.exe from older to newer version . 在这里,您只需将Zipalign.exe从较旧版本复制到较新版本。

It worked for me. 它对我有用。 I used it in BluetoothLegatt sample code. 我在BluetoothLegatt示例代码中使用它。

In Windows, make sure your ANDROID_HOME is pointing to the right folder. 在Windows中,确保您的ANDROID_HOME指向正确的文件夹。 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: 我更新了它,但我忘了指向较新的SDK文件夹:

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

Now I'm sure I'm using the last SDK tools for Android. 现在我确定我正在使用Android的最新SDK工具。

Ok, now update the gradle script: 好的,现在更新gradle脚本:

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

and

android {
    buildToolsVersion "19.1"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 执行 Android 项目“活动 class 不存在”时出错。 - Error while excuting Android Project "Activity class does not exist." 运行项目时,Android Studio不显示我的设备 - Android Studio does not show my device while running the project 错误:(11, 24) 错误:包 javafx.animation 不存在。 (Android Studio、Libgdx、Javafx) - Error:(11, 24) error: package javafx.animation does not exist. (Android Studio, Libgdx, Javafx) 在运行我的Android Studio项目时,Java编译器会出现此错误 - While running my Android studio project, Java compiler gives this error 在android studio上运行项目时出现会话错误 - session error while running project on android studio 在Android Studio中运行项目时出现内存不足错误 - Out of Memory error while running project in android studio 在Android Studio中运行Flutter项目时发生Gradle错误 - Gradle Error while running flutter project in Android Studio Android Studio项目运行错误 - Android Studio project running error 如何解决Android Studio中的“本地路径不存在”错误? - How can I solve “Local path doesn't exist.” error in Android Studio? 错误:构建应用程序时出现“包com.tumblr.remember不存在。” - Error: “package com.tumblr.remember does not exist.” while building the app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM