Android Studio 错误 13=Linux 中的权限被拒绝 [英] Android Studio error 13=permission denied in linux

查看:87
本文介绍了Android Studio 错误 13=Linux 中的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

i am using android studio latest version in linux(elementary luna to be specific). I installed jdk, android studio and sdk successfully, android studio opens us perfectly and even i can work on my app. but when i bulid app it gives error 13: permission denied and it opens a black circle image png in new tab.

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

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

i dont understand the problem. i did searched on internet and tried many methods like

  1. 使用 chmod 更改权限:

  1. changing permissions with chmod:

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

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

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

it executes successfully but with no effect on the problem itself,

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

2.closing and re-importing project,

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 位系统的.

i guess this is not issue since my system is 32 bit and this is for 64 bit systems.

有人可以帮忙吗?因为我真的很依赖它.

Can anyone help? since i am really counting on it.

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

my system configurations:(if useful)

-OS 版本:0.2.1 "Luna"(32 位),构建于:Ubuntu 12.04(精确")

-OS Version: 0.2.1 "Luna" ( 32-bit ), Built on: Ubuntu 12.04 ( "Precise" )

安装的 OpenJdk 7:java版本1.6.0_34"OpenJDK 运行时环境 (IcedTea6 1.13.6) (6b34-1.13.6-1ubuntu0.12.04.1)

-installed OpenJdk 7: java version "1.6.0_34" OpenJDK Runtime Environment (IcedTea6 1.13.6) (6b34-1.13.6-1ubuntu0.12.04.1)

OpenJDK Client VM(构建 23.25-b01,混合模式,共享)

OpenJDK Client VM (build 23.25-b01, mixed mode, sharing)

推荐答案

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

I'm running android studio 1.0.2 on ubuntu 14.04 (LTS) 32 bit and i had the same problem. just go to "/home/suUs12/Android/Sdk/build-tools/21.1.2/" and then right click on 'aapt' file , properties -> permissions and check 'Allow executing file as program'. then close the window.

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

In my case,after giving permission for 'aapt' file, I had to give the same permission for 'dx' and 'zipalign' files in the same directory (/home/suUs12/Android/Sdk/build-tools/21.1.2/) and I was able to run my first app using android studio.

这篇关于Android Studio 错误 13=Linux 中的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆