【问题标题】:Unable to build, nor clean a naked single activity project in a newly installed Android studio无法在新安装的 Android 工作室中构建、清理裸单活动项目
【发布时间】:2015-05-08 20:59:20
【问题描述】:

我最近在我的 Ubuntu 14.04 LTS 上安装了最新的稳定版 Android Studio。 SDK 配置正确。

我从空白的 Activity 模板创建了一个“Activity”项目,并且没有对其进行任何更改。

在尝试构建或清理时,我偶尔得到以下信息:

Failed to complete Gradle execution.

Cause:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

根据 VM 的堆大小,seems 将变为 caused。但是添加XX:MaxPermSize=1024m 只会减少它发生的次数,这意味着,有时我没有得到这个错误,没有改变任何东西。 所以要么它不是真正的解决方案,要么 1024m 还不够(这似乎不对..)

但是,当我没有收到此错误时,构建仍然失败:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
:app:mergeDebugResources FAILED
/home/a/AndroidStudioProjects/useless/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/a/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 127
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/a/AndroidStudioProjects/useless/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/a/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 127
Information:BUILD FAILED
Information:Total time: 13.341 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

witch 信息量不大。

【问题讨论】:

    标签: android android-studio android-gradle-plugin build.gradle


    【解决方案1】:

    在 ubuntu 14.10[64 bits] & 15.04[64 bits] 你可以解决这个问题,也可以解决 this genymotion 的问题

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
    

    祝你好运!!

    【讨论】:

      【解决方案2】:

      您必须安装这些软件包才能解决此错误,因为 Android SDK 仍然无法在 UBUNTU 64 位上运行。

      sudo apt-get install lib32stdc++6
      sudo apt-get install lib32z1
      

      【讨论】:

        【解决方案3】:

        好的,奇怪的是this 解决了这个问题(第二个)。 这很奇怪,因为没有办法从 gradle outout 中理解它。

        【讨论】:

          猜你喜欢
          • 2019-09-26
          • 1970-01-01
          • 1970-01-01
          • 2019-03-27
          • 2014-09-18
          • 1970-01-01
          • 1970-01-01
          • 2013-08-06
          • 1970-01-01
          相关资源
          最近更新 更多