Java “aapt”IOException 错误=2,没有这样的文件或目录”为什么我不能在 jenkins 上构建我的 gradle?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22701405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 17:21:04  来源:igfitidea点击:

"aapt" IOException error=2, No such file or directory" why can't I build my gradle on jenkins?

javaandroidjenkinsgradleaapt

提问by Neifen

I have a little problem.

我有一个小问题。

The Problem:
I am trying to build a gradle of my Android Project on Jenkins and now I am standing on this problem i can't resolve. During the Building I have this Error message:

问题:
我试图在 Jenkins 上构建我的 Android 项目的 gradle,现在我站在这个我无法解决的问题上。在构建过程中,我收到此错误消息:

:Client:mergeDebugResources
/var/lib/jenkins/workspace/LMA-Client/Client/build/exploded-aar/com.google.android.gms/play-services/3.1.59/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png: 
Error: Cannot run program "/opt/android-sdk/build-tools/19.0.1/aapt": java.io.IOException: error=2, No such file or directory
:Client:mergeDebugResources FAILED

You can imagine that this aapt... yep its there and the png... its there too, so the mistake must be somewhere else.

你可以想象这个 aapt...是的,它在那里,而 png...它也在那里,所以错误一定是在其他地方。

The Solution?
Now I googled 1-2 hours around, surfed on this great Website and what I found is that if Jenkins runs on a 64-bit system, I need to install the ia32-libs. Like that:

解决方案?
现在我在谷歌上搜索了 1-2 个小时,在这个很棒的网站上冲浪,我发现如果 Jenkins 在 64 位系统上运行,我需要安装 ia32-libs。像那样:

sudo apt-get install ia32-libs

now I tried that, and I couldn't install it:

现在我试过了,但我无法安装它:

The following packages have unmet dependencies:
 ia32-libs : Depends: ia32-libs-multiarch

so I tried to install "ia32-libs-multiarch", but again:

所以我尝试安装"ia32-libs-multiarch",但再次:

The following packages have unmet dependencies:
 ia32-libs-multiarch:i386 : Depends: libgphoto2-2:i386 but it is not going to be installed
                            Depends: libsane:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Finally
so finally im standing here and asking me: is that really the solution? And why should I install this thing? And how? So please help me, I think I am not far away from the answer.

最后
我终于站在这里问我:这真的是解决方案吗?为什么我要安装这个东西?如何?所以请帮助我,我想我离答案不远了。

采纳答案by robd

I had the following similar error on Ubuntu 13.10:

我在 Ubuntu 13.10 上遇到了以下类似的错误:

Cannot run program "/usr/local/android-sdk-linux/build-tools/19.0.3/aapt": error=2, No such file or directory

Cannot run program "/usr/local/android-sdk-linux/build-tools/19.0.3/aapt": error=2, No such file or directory

And this answerfixed it for me:

这个答案固定对我来说:

To get aapt working (this fixed my issues with the avd as well) just install these two packages:

sudo apt-get install lib32stdc++6 lib32z1

要让 aapt 工作(这也解决了我的 avd 问题),只需安装这两个软件包:

sudo apt-get install lib32stdc++6 lib32z1

回答by Cheezmeister

For Arch 64 users, you must first enable multilibfor pacman, then install the 32-bit packages:

对于 Arch 64 用户,您必须首先为 pacman启用 multilib,然后安装 32 位软件包:

sudo pacman -Syv lib32-libstdc++5 lib32-zlib

回答by worker

I installed ndkin the sdk managerand it worked.

我在sdk 管理器中安装了ndk并且它起作用了。

回答by Julien H. - SonarSource Team

For Fedora users:

对于 Fedora 用户:

sudo dnf install zlib.i686 libstdc++.i686