I am unable to set the Android SDK Path on a fresh install of Android Studio for Ubuntu 14.04. Clicking 'Apply' and 'OK' do not do anything, even though the supplied path is valid.
This error does appear to be linked to file permissions. Another option rather than granting read write and execute rights to everyone is to change the owner/group of the files like so:
sudo chown -R UserNameHere:UserGroupHere android-studio
My Android SDK directory did not have the necessary permissions.
I blindly updated them with
$ sudo chmod -R 777 /urs/bin/android-studio/
and it now works.
I reported a bug for this: https://code.google.com/p/android/issues/detail?id=73155
Related
I am using android studio 3.4.2. When I try to update
the android studio it says
"Studio does not have write access to /app/extra. Please Run it by a privileged user to update"
How to solve it?
I would suggest to set your current user as owner of /usr/bin/android-studio
This will resolve the issue in long term:
sudo chown -R $USER:$USER /usr/bin/android-studio
Navigate to your Android studio folder via terminal then run android studio with administrator privileges, using sudo or su. If you provide more information, like which OS you are using, maybe I'll be able to tell you the exactly command line you should use.
Edit:
Open terminal application, then type de following :
cd ~/android-studio/bin *
Now we must run Android Studio script file studio.sh as administrator:
sudo ./studio.sh
If doesn't work try : sudo sh studio.sh
(Optional) To prevent this problem every time you want update android studio, see https://stackoverflow.com/a/37704528/8513494
And is it.
I'm assuming that your android studio is located on your user folder, if there's a problem with this step, you should check /opt/ directory and look out for android studio installation folder or see https://superuser.com/a/1080329
I would suggest setting up your current user as the owner of Android Studio
Linux
sudo chown -R $USER:$USER /usr/bin/android-studio
Mac
sudo chown -R $USER /Applications/Android\ Studio.app
or if you using android studio portable then you can use custom path like this.
sudo chown -R $USER: pathDirOfYourAndroidStudio/Android\ Studio\ Preview.app
For linux mint 20:
sudo chown -R $USER:$USER /opt/android-studio-4.2/android-studio/
Happens on Mac when you do not have Android studio in /Application directory. Move it there, if it is not resolved, try this answer.
Set access to Read and Write (default is Read only)
I'd suggest changing the owner of the android-studio directory, doing so depends on the path of your android studio. Here is mine
sudo chown -R $USER:$USER /opt/android-studio
But you might have the following path
sudo chown -R $USER:$USER /usr/bin/android-studio
Check well and enjoy
If you are a MAC user and running portable AS then the simple solution is to move the application within Application folder. Check this video. It solves my issue after wasting 3 hrs within the terminal but nothing is wasting of time. I am running MACOS 13(Ventura) & AS Electric Ele.
I am new to the Linux. I am using centos 7 and trying to install the emulator. I have installed android-sdk. while I try to create SD Card in the emulator I get error stating that : error while loading shared libraries: libgcc-s.so.1: cannot open shared object file. No such file or directory exist.
You can refer following links.
want to create folder in sdcard on AVD
https://askubuntu.com/questions/409905/apt-get-error-loading-libgcc-s-so-1
https://confluence.atlassian.com/display/STASHKB/libgcc_s.so.1%3A+cannot+open+shared+object+file%3A+No+such+file+or+directory
There isn't very much documentation for using the emulator with Centos.
I ran into a similar problem and found the issue was that I didn't set the LD_LIBRARY_PATH environment variable.
Try executing this line before you start the emulator:
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
Simply adding this line wasn't enough, I had to install the package because I didn't have it.
If you run into this issue, try:
yum provides \*/libgcc_s.so.1
Check to see which package you need (32-bit or 64-bit) and install it using this command:
sudo yum install <package-name>
If the package is already installed, I suggest uninstalling all packages that refer to the file and reinstalling only the one you need:
sudo yum remove <package-name>
Hopefully this is useful to someone... good luck!!
I use Ubuntu 14.04 LTS.
My JDK version is 1.8.0_31.
I downloaded Android Studio archive, unpacked it and ran a studio.sh file. But every time the installation begins an error occurs:
Refresh Sources:
Failed to fetch URL http ://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: File not found
Fetched Add-ons List successfully
Refresh Sources
Failed to fetch URL http ://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
Refresh Sources:
Failed to fetch URL http ://dl-ssl.google.com/android/repository/repository-10.xml, reason: File not found
There is nothing to install or update.
The following SDK components were not installed: build-tools-21.1.1, source-21, sys-img-x86-addon-google_apis-google-21, extra-android-m2repository, android-21, extra-google-m2repository, addon-google_apis-google-21, platform-tools
Moreover, when I run the studio.sh file following text appears in terminal:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Also I tried to install the Android Studio from Paolo Rotolo's repository, but the same problem occurs.
I am rookie in Ubuntu, so I hope only for your help.
I also met this problem. Even I can download the xml files from browser, the android update sdk process keep reporting file not found. A search from google leads me to here:
https://code.google.com/p/android/issues/detail?id=76268
The first anwser reminds me of permission problem of ~/.android. I checked, and found that this hidden directory is not owned by me. Change the owner of the directory solve the problem.
Its not that tough actually, just follow the following steps:
first of all make sure your ubuntu is uptodate. open >Unity>Software updater.
Install latest Jdk - in my case its Java8
Installing java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Make it default version
sudo apt-get install oracle-java8-set-default
Installing Android Studio
Download Android Studio from here, use All Android Studio Packages
Extract the archive file into an appropriate location for your applications, eg: /opt. Use the filename of your downloaded archive, in my example android-studio-ide-141.2178183-linux.zip
sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
To launch Android Studio, navigate to the /opt/android-studio/bin directory in a terminal and execute ./studio.sh. Or use a desktop file, see below. Make sure you type "./studio.sh"
You may want to add /opt/android-studio/bin to your PATH environmental variable so that you can start Android Studio from any directory.
sudo studio.sh
running it as root solved for me
when ever I run the cordova/build, I get following ERROR:
Execute failed: java.io.IOException: Cannot run program "../android-studio/sdk/build-tools/android-4.4W/aapt"
what should I do?
I moved my Android Developer Tools (ADT) folder from Ubuntu's partition to Linux Mint's partition, but accidentally put in inside my web server's root folder and the permission of ADT's folders were set to 755, the files were set to 644 by my shell script to rebuild the permissions for my new web server.
After I moved ADT to my home folder and started using Android Studio, I got this problem.
sudo chown $USER:$USER -R /home/myusername/my-adt-folder
doesn't help.
GNU C Library was already installed by default. Not sure why it is related to this problem.
I decided to set 777 permission to ADT and it worked.
sudo chmod 777 -R /home/myusername/my-adt-folder
That's it.
It seems another system user in the system needs to access to android-4.4W/aapt file.
I solved it by installing lib32-glibc.
https://www.archlinux.org/packages/multilib/x86_64/lib32-glibc/
If you just want aapt on Arch without the overhead/hassle of setting up ADT then you can try the solution that I presented on the Android Enthusiasts site here.
I am using ubuntu 13.04 I have just set up eclipse and android sdk. But whenever i try to run program or even if I am switching DDMS perspective it shows me permission denied error.
How to tackle this issue.
#Manoj,
Try running following
cd /home/manoj/....../platform-tools
adb version
If you get a Permission denied error then
chmod 770 adb
adb version
you should get a response like "Android Debug Bridge Version x.x.xx"
If so the source of your problem was file permission and set the file permission appropriately
Also check if the $PATH includes the path to /home/manoj/....../platform-tools.
Disclaimer: I use Ubuntu 12.04 and adb at command prompt for my work. I hardly use eclipse for my current work.
Let us know your results
Good luck
Another issue might be adb's file permissions themselves, make sure the user you are using to run eclipse is the same as who owns the adb files. Also make sure that adb is actually executable. (These are both unlikely issues, but worth checking if the other solutions given don't fix it)
From the home directory, try 'adb' in terminal:
If 'adb' doesn't find the adb tool, then your path needs adjusted. (edit .bashrc with bash commands to append to the path the /tools directory of the android sdk, is probably the easiest way, then log out and back in to apply the settings)
If 'adb' says it needs root permission, then try 'sudo adb' and see if that works. (this shouldn't happen, but worth testing)
I'm not actually sure what it says for 'non executable' in 13.04, but it should be self explanatory.
I have solved this problem through following steps:
1. copy & unzip eclipse to /opt/android/android-sdk-linux/
2. x86= sudo apt-get install libgl1-mesa-dev
x64(Ubuntu 13.04 and earlier)= sudo apt-get install ia32-libs
x64(Ubuntu 13.10 and above)= sudo apt-get install libgl1-mesa-dev:i386
I use ubuntu 14 and on this version listed packages have multiple dependencies, so if you could not install this package use apt-get -f install (without package) . this statement install dependencies.
3. sudo gedit /etc/environment
:/opt/android/android-sdk-linux/tools
:/opt/android/android-sdk-linux/platform-tools
the same happened for me when i used adb version it showed adb server not installed ,and it showed how to fix it ,and now works fine ,install the adb server using the following code .
The program 'adb' is currently not installed. You can install it by typing:
sudo apt-get install android-tools-adb