Android SDK管理器linux权限问题

时间:2015-05-06 12:43:33

标签: android linux eclipse netbeans archlinux

问题是如果我不是root用户,我就无法在sdk管理器上安装任何东西。 " android"工具运行,但我得到权限错误。但是,当我尝试以root身份运行时,我得到了这个:

java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1616)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1577)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:350)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:373)
at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:254)
at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:122)
at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:407)
at com.android.sdkmanager.Main.doAction(Main.java:390)
at com.android.sdkmanager.Main.run(Main.java:150)
at com.android.sdkmanager.Main.main(Main.java:116)

我跑了Archlinux 64位btw

2 个答案:

答案 0 :(得分:1)

由于它安装在/ opt目录中,最好的方法是创建一个用户组,并将您的用户添加到他的组中:

# groupadd sdkusers
Add your user into this group:
# gpasswd -a <user> sdkusers
Change folders group.
# chown -R :sdkusers /opt/android-sdk/
Change permissions of the folder so the user that was just added to the group will be able to write in it:
# chmod -R g+w /opt/android-sdk/

source

答案 1 :(得分:0)

删除 .android 文件夹即可。