Android Studio 错误 13=权限在 linux 中被拒绝

标签 android linux android-studio

我在 linux 中使用最新版本的 android studio(具体来说是 elementary luna)。我成功安装了 jdk、android studio 和 sdk,android studio 完美地打开了我们,甚至我可以在我的应用程序上工作。但是当我构建应用程序时,它给出错误 13:权限被拒绝,并在新选项卡中打开一个黑色圆圈图像 png。

Information:Gradle tasks [:app:compileDebugSources]
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
: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
:app:mergeDebugResources FAILED
/home/suUs12/AndroidStudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png
Error:Error: Cannot run program "/home/suUs12/Android/Sdk/build-tools/21.1.2/aapt": error=13, Permission denied
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/suUs12/AndroidStudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/drawable-mdpi/abc_btn_radio_to_on_mtrl_000.png:
Error: Cannot run program "/home/suUs12/Android/Sdk/build-tools/21.1.2/aapt": error=13, Permission denied
Information:BUILD FAILED
Information:Total time: 30.305 secs
Information:2 errors
Information:0 warnings

我不明白这个问题。我确实在互联网上搜索并尝试了很多方法,比如

  1. 使用 chmod 更改权限:

    chmod +x/home/alex/android-studio/sdk/build-tools/android-4.2.2/dx

它执行成功但对问题本身没有影响,

2.关闭并重新导入项目,

3.我也试过这个,

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

我得到以下结果

suUs12@suUs12:~/Android/Sdk$ sudo apt-get install lib32stdc++6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package lib32stdc++6 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'lib32stdc++6' has no installation candidate

我想这不是问题,因为我的系统是 32 位的,而这是针对 64 位系统的。

有人可以帮忙吗?因为我真的指望它。

我的系统配置:(如果有用的话)

-OS 版本:0.2.1“Luna”(32 位), 基于:Ubuntu 12.04(“精确”)

-已安装 OpenJdk 7: Java 版本“1.6.0_34” OpenJDK运行环境(IcedTea6 1.13.6) (6b34-1.13.6-1ubuntu0.12.04.1)

OpenJDK 客户端 VM(build 23.25-b01,混合模式,共享)

最佳答案

我在 ubuntu 14.04 (LTS) 32 位上运行 android studio 1.0.2,我遇到了同样的问题。 只是去 “/home/suUs12/Android/Sdk/build-tools/21.1.2/” 然后右键单击“aapt”文件,属性 -> 权限并选中“允许作为程序执行文件”。 然后关闭窗口。

在我的例子中,在为“aapt”文件授予权限后,我必须为“dx”和“zipalign”授予相同的权限>' 文件在同一目录 (/home/suUs12/Android/Sdk/build-tools/21.1.2/) 中,我能够使用 android studio 运行我的第一个应用程序。

关于Android Studio 错误 13=权限在 linux 中被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28564677/

相关文章:

arrays - shell中输入的数字

linux - getopts : unable to identify arguments

android fragment listview 部分显示项目

android - opengles- 如何呈现动态对象列表并更新每一帧的位置

android - Google Play 订阅订单不存在

c - Linux:我的 char 驱动程序在 sysfs 中创建了一个节点,但在重新加载后无法清除它

android - Espresso 测试不更新

java - 无法在 Android Studio 中创建类文件

android - 我应该进入 Android Studio 还是应该坚持使用 Eclipse?

android - 如何在 Eclipse API 16 (fontFamily) 中使用 native Android OS 4.1 Roboto 字体