android - 在 Linux 机器上使用 Ant FAILED 为 Android 构建失败,但在 Mac 机器上成功

标签 android linux ant build

我正在尝试使用 linux 机器上的 ant 构建 android 项目。该项目在我的 Mac 机器上构建没有问题,但在 linux 机器上构建。似乎无法弄清楚为什么!

我输入了

ant release

然后我收到以下消息:

 BUILD FAILED
/android/android-sdk-linux/tools/ant/build.xml:885: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:887: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:899: The following error occurred while executing this line:
/android/android-sdk-linux/tools/ant/build.xml:281: null returned: 137

build.xml 文件中的行是

275 <dex executable="${dx}"
276                    output="${intermediate.dex.file}"
277                    dexedlibs="${out.dexed.absolute.dir}"
278                    nolocals="@{nolocals}"
279                    forceJumbo="${dex.force.jumbo}"
280                    disableDexMerger="${dex.disable.merger}"
281                    verbose="${verbose}">
      <path path="${out.dex.input.absolute.dir}"/>
      <path refid="out.dex.jar.input.ref" />
      <external-libs />
    </dex>
.
.
.
.
.

884   <target name="-dex" depends="-compile, -post-compile, -obfuscate">
885      <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
886      <!-- only convert to dalvik bytecode is *not* a library -->
887      <do-only-if-not-library elseText="Library project: do not convert bytecode..." >
888         <!-- special case for instrumented builds: need to use no-locals and need
889                 to pass in the emma jar. -->
890            <if condition="${build.is.instrumented}">
891                <then>
892                    <dex-helper nolocals="true">
893                        <external-libs>
894                            <fileset file="${emma.dir}/emma_device.jar" />
895                        </external-libs>
896                    </dex-helper>
897                </then>
898                <else>
899                    <dex-helper />
                </else>
            </if>
        </do-only-if-not-library>
    </do-only-if-manifest-hasCode>
</target>

希望有人能帮忙

最佳答案

找到解决方案。看来这是一个权限问题。在 linux 上构建时,我必须具有写入和执行权限。

关于android - 在 Linux 机器上使用 Ant FAILED 为 Android 构建失败,但在 Mac 机器上成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17138216/

相关文章:

java - ${aapt} 如何定义? (没有这样的文件或目录)

java - 在ant中删除一个文件

android - 我应该在哪里放置选择器代码?

java - 在用户捐款/未捐款后隐藏/显示 SrartApp 广告

android - 在真机上运行Android+Opencv+NDK App

linux - 不同 Perl 安装的困惑

python - 如何使 Python 脚本像 Linux 中的服务或守护程序一样运行

Linux .sh 在回显时自动将局部变量设置为空

eclipse - 无法解析 JRE : jdk7 (Standard VM)

java - 在每次访问应用程序时使用 SharedPreferences 将数据附加到数组中