I am facing a problem with Ubuntu as I am new to Ubuntu.
What I have done is, Installed Eclipse Kepler and android-sdks in /home and set SDK location to /home/android/android-sdks in Eclipse (Window -> Preferences -> Android). everything is working fine. later I understood that SDK is taking too much hard disk space (nearly 6 GB) so I have copied android-sdks to /media/Softwares/android folder and deleted from /home/android.
now When updating SDK location in Eclipse to /media/Softwares/android/android-sdks, I am getting below Exception
[2013-12-11 22:38:05 - adb] Unexpected exception 'Cannot run program "/media/Softwares/android/android-sdks/platform-tools/adb": error=13, Permission denied' while attempting to get adb version from '/media/Softwares/android/android-sdks/platform-tools/adb'
please help me to solve this issue...
thanks in Advance...
You should not have put your stuff into media directory. This is where the system mounts drives. I believe '/usr' would be a more suitable place for your sdk.
if you have problems with access to some directory, navigate to it from the terminal and use 'chmod' command.
chmod 777 -R xxx (where xxx is a name of the directory you want to change access rights to) will give all possible access rights to all users
Related
When I trying to install Android Studio on my PC so the error occurs it says:
The IDE cannot create the directory. Possible reason: parent directory is read-only or the user lacks necessary permissions.
If you have modified the idea.config.path property, please make sure it is correct,
otherwise, please re-install the IDE.
Location: C:\Users\Acer/.AndroidStudio4.0/config
java.nio.file.AccessDeniedException: C:\Users\Acer.AndroidStudio4.0
I had the same problem but on MacOS, so I thought it might be useful to share the solution for someone who is using Mac like me.
Navigate to: /Applications/Android Studio.app/Contents/MacOS, i.e. on terminal execute the following: cd /Applications/Android\ Studio.app/Contents/MacOS then execute: sudo ./studio. This would be enough for the IDE to be executed once so it can create config folder and file. Then everything will be ok.
I just ran into this bug on a MacBook and to fix it I ran:
sudo chmod 777 ~/Library/Application\ Support/Google
in the terminal.
The above answer helped me solve it on my machine, but I had to create a directory for Android studio in the designated folder and give that proper permission.
Steps
Navigate to username/Library/Google
if there is an AndroidStudio{version} folder, jump to step 3, otherwise create a new folder called AndroidStudio{version} where you swap out the version number. You can find the number in the error message spelled out at the bottom.
right click that folder, and get info.
go to sharing & permissions and give staff+everyone: read-write permission.
TLDR:
Add read/write permissions to the folder that the IDE mentions.
If it does not exist create it
Ensure that the folder has READ/Write permissions for your local user.
After all this the app would still crash when opening new tabs. So i had to run defaults write com.google.android.studio AppleWindowTabbingMode manual as found in this answer. https://stackoverflow.com/a/64907362/1461176
I ran into this issue recently on Mac OS Sierra. I wasn't comfortable running the app in sudo or setting generic directories like Library/Catches as globally read/write by all users.
The full message was:
The IDE cannot create the directory.
Possible reason: parent directory is read-only or the user lacks necessary permissions.
If you have modified the 'idea.config.path' property, please make sure it is correct,
otherwise, please re-install the IDE.
-----
Location: /Users/username/Library/Application Support/Google/AndroidStudio4.1
java.nio.file.AccessDeniedException: /Users/username/Library/Application Support/Google/AndroidStudio4.1
I have another mac that has Android Studio already setup. So I investigated how it was setup.
The location of the folder was slightly different: /Users/username/Library/Application\ Support/AndroidStudio4.1/.
Notice it's not in the shared Google folder. This shouldn't matter but I believe can be configured with idea.config.path.
The difference in path is probably related to the version of Android Studio that was initially installed.
After opening the permissions on that folder in the working computer, i noticed it had Read/Write for my local user.
Yet the offending computer did not.
I can confirm that editing the permissions fixes this issue and you can reproduce if you remove it.
cd to the path output in the error in my case that was: `cd /Users/username/Library/Application Support/Google/AndroidStudio4.1
If it does not exist create it sudo mkdir /Users/username/Library/Application Support/Google/AndroidStudio4.1
open the parent folder open /Users/username/Library/Application Support/Google/
Right click -> Get Info on the /Users/username/Library/Application Support/Google/AndroidStudio4.1
Select the lock in the bottom right
Select the plus + button on the bottom right.
Enter your login password
Select your username
Change Privilege field for your username to Read/Write
Press the lock
Close the window
Open android Studio
Similar Error
If you receive an error related to creating temp files in the the folder the folder is present but it's permissions are still not correct.
Possible reason: the directory is read-only or the user lacks necessary permissions.
If you have modified the 'idea.config.path' property, please make sure it is correct,
otherwise, please re-install the IDE.
-----
Location: /Users/username/Library/Application Support/Google/AndroidStudio4.1
java.nio.file.AccessDeniedException: /Users/username/Library/Application Support/Google/AndroidStudio4.1/ij1547365868.tmp
I had a similar problem on Ubuntu. At first, I tried running ./studio.sh as root. However, I faced other issues down the line. So I cleaned the .cache directory that was created by the root user, also deleted the Google/AndroidStudio* and "Android Open Source Project" under .config.
Then I was able to run ./studio.sh without any root permissions.
my problem was solved by visiting the
C:\Users\Myusername\AppData\Local\JetBrains
and giving it the proper permission.
This error is caused by permission problem at the spelled out folder at the bottom of the error message.
for Mac, go to YourUserName/Library/Catches. Right click on the catches folder, go to Get Info, and change the "Sharing & Permissions" settings under "everyone" and "staff" to "Read & Write".
I had the same issue trying to build a project using capacitor. I was able to fix it simply by adding sudo before the command. So instead of npx cap open android I did sudo npx cap open android and it worked.
Also this issue can occur if there is no enough space on your PC. So double check it just to be sure. Generally answer provided by T-D helps to get more descriptive message in that case.
On my mac, same error, I deleted this folder:
/Users/xxxxxxxxxxx/Library/Caches/Google
Which was a symlink to /Volumes/RamDisk/Library/Caches/Google
It works perfectly.
In MacOS the folders inside /Users/<user>/Library/Application Support/ should all be owned by <user>:staff.
In my case /Users/<user>/Library/Application Support/Google was owned by root:staff.
Fixed it by doing: sudo chown <user>:staff /Users/<user>/Library/Application Support/Google
IMO this is a better solution than relaxing the permissions of the folder with chmod 777 like others suggested.
If anyone still facing this issue give chmod 777 permission to the specified paths that error dialog is showing, in my case I had to give permission to Library/Logs and Library/Google
Example:
sudo chmod 777 ~/Library/Logs
sudo chmod 777 ~/Library/Google
I've encountered the same issue and here is the solution that worked for me. You need to navigate to where it was initially installed(if installed in the Application folder).
Run this command:
cd /Applications/Android\ Studio.app/Contents/MacOS
then
sudo ./studio
My application code is written and executed with no errors. However my emulator will not show up nor does my android device that's plugged in (virtualization is turned on, SDK packages are downloaded, Hyper V is not installed). I get this message from the ADB console:
adb is not recognized as an internal or exteral command, operable program or batch file.
I have tried editing the %PATH% in both system and user variables but it never works.
I am using the latest Android studio and all the tutorials and answers to my problem refer to Eclipse. At this point I am wondering if I should just abandon Android studio and take refuge in the larger Eclipse community.
Can anyone advise me how to fix it? I've been already trying a long time and I would like to finally see my application in action.
Your PATH is incorrectly setup.
For Windows :
Open up Command Prompt
and type
setx ANDROID_ADB_PATH "pathtoyoursdkplatformtools" /m
example:
setx ANDROID_ADB_PATH "C:\android-sdk-win\platform-tools" /m
Identify the exact location of your SDK. From command prompt cd to that folder and execute adb from there. if it still fails, your installation is corrupted. Delete all previous installtions of Android Studio and install fresh. If it works from adb folder , then you are making a mistake in setting up the path correctly.
set PATH=%PATH%;C:\Program Files\android-sdk-windows\platform-tools
this will only work for that particular session though.With respect to HAXM, always make sure the memory you allocate for a AVD is less than 650MB and check the Use Host GPU checkbox.
You've to set the adb.exe path location here.
You can find that, file>other setting>default project structure>{get your sdk file location}
Ex: C:\Users\Spectrum_Developer\AppData\Local\Android\Sdk
Open this path in file explorer and get into platform-tools. You can see adb.exe here.
Set this current path which is for ex. C:\Users\Spectrum_Developer\AppData\Local\Android\Sdk\platform-tools in your system environmental path variable
Restart the system.
Happy coding :-)
I'm using Mac OSX 10.7.5 and I recently re-install the newest ADT 23 which version named "adt-bundle-mac-x86_64-20140624".
I removed the older version of ADT which only support to API 18 (I don't remember what the version code is it...) before install the new one.
While I completed installation, update API to 19 by SDK Manager, but I haven't updated 4.4W and API 20.
I tried to create a new emulator with the setting value on SD Card field, and then press OK.
The console panel would occurred error message:
[2014-07-09 02:44:13 - SDK Manager] Failed to create the SD card.
[2014-07-09 02:44:13 - SDK Manager] Failed to create sdcard in the AVD folder.
With the same creating steps, the problem above haven't displayed in the older version of ADT that I used before.
I tried if I don't set SD card value to create a new emulator, that can be created successfully!
I also tried to install Eclipse 4.4 Luna and the newest SDK package separately, it still has the same problem...
I'm not sure if there's any problem on my OSX or have I missed any steps of settings during installation.
Please kindly give me some suggestions to fix my problem, appreciate!
It's been 2 months since you've opened this case, so I hope that you've reached a resolution by now. I've actually experienced the same issue with creating an SD Card on my Mac 10.7.5 OS using the Eclipse ADT Bundle. When I couldn't rely on the GUI, I moved over to using the CLI for creating the sdcard using the mksdcard command located in the sdk/tools folder (ex: mksdcard 64M /tmp/sdcard.img). In doing so, I noticed that I was receiving an Illegal Instruction: 4 error. When tracking this error down further (ex: What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?) I noticed that it's an issue with the way that the mksdcard command was compiled and that my 10.7.5 OS was not capable of executing this command.
Resolution (at least for my case):
Backup the mksdcard command in the tools folder. Example cp
mksdcard mksdcard.bak
Download a previous version of the tools that were known to work on the 10.7.5 OS (http://dl-ssl.google.com/android/repository/tools_r22.6.2-macosx.zip)
Extract the tool and copy the mksdcard command from the newly extracted folder to your Eclipse/sdk/tools folder (essentially replacing the mksdcard command that we know doesn't work).
Restart Eclipse
Create a new AVD using the AVD manager and assign a value (ex: 32M) for the sdcard
You should no longer see the failed to create sdcard error.
Resolution 2:
Update your Mac to a later version (10.8.x or above). I've tested this and have confirmed that mksdcard is working on later versions of Mac OS X without this issue.
Let me know if this resolves your issue as well.
You can try run this in shell
cd /Users/MyUserName/Library/Android/sdk/tools/
chmod +x mksdcard
Android Studio IDE on Mac os:error=13, Permission denied
in my case , i just update android Emulator.
SDK Manager -> android sdk -> sdk tools.
update Android Emulator
I think there's a bug in the GUI that's not letting you past the SD card step. You could try skipping the GUI by using the 'android' command directly. After experiencing this problem, I was able to create an AVD using this command:
$ android create avd -t 3 -n TestAVD
This uses a lot of defaults. To see options for '-t', use 'android list targets'. Take a look at the options for 'create avd' with this command:
$ android --help create avd
Hope that helps.
I did set up of Android, Java and Eclipse to start up my project but soon after running my emulator a few times I got error like “The connection to adb is down, and a severe error has occured.”
I referred to this question and got answer but while running adb from command prompt I am getting error as "'adb' is not recognized as an internal or external command,operable program or batch file."
How to run this adb commands without admin rights on machine?
but while running adb from command prompt i am getting error as "'adb' is not recognized as an internal or external command,operable program or batch file."
This is usually a path problem.
Linux
This is usually one of two problems on Linux.
First, adb is simply not on path. Its located in <Android SDK>/platform-tools, so platform-tools needs to be on path. To ensure its on path, you want something like this in your login script (.bashrc, .bash_profile, etc). Below is from Mac OS X and .bash_profile:
export JAVA_HOME=`/usr/libexec/java_home`
export ANDROID_NDK_ROOT=/opt/android-ndk-r9c
export ANDROID_SDK_ROOT=/opt/android-sdk-macosx
export PATH="$ANDROID_SDK_ROOT/tools/":"$ANDROID_SDK_ROOT/platform-tools/":"$PATH"
Second, the problem can occur on Linux if its x86_64 and you don't have ia32_libs installed. Tools like adb are 32-bit, so you need to install ia32_libs for the entire 32-bit subsystem for 64-bit Linuxes.
Windows
Windows has a PATH variable, and it can be adjusted per-user. Ensure <Android SDK>/platform-tools is on path in Windows. It would not hurt to ensure <Android SDK>/tools is on path also.
If you add a %PATH% variable, you can copy it from the System's %PATH% first. Then modify your copy.
You getting error like "'adb' is not recognized as an internal or external command,operable program or batch file." has nothing to do with your admin rights.
Follow the steps:
Go to folder location where your 'adb.exe' is located.
copy the path and open cmd prompt and paste your folder location
Example: C:\Users\298xxx>C:\Android\adt-bundle-windows-x86-20131030\adt-bundle-windows-x8
6-20131030\sdk\platform-tools\adb.exe
Run any adb command you want like
C:\Users\298xxx>C:\Android\adt-bundle-windows-x86-20131030\adt-bundle-windows-x86-20131030\sdk\platform-tools
\adb.exe devices
List of devices attached
emulator-5554 device
Problem is that in machine you need to set path of ADB.exe in system properties but you didn't had access as admin which don't allowed you to open/work directly with system related things like install/uninstall/path setting and many more.
Another way to do the same is
press ctrl+alt+del to open task manager
Go to File --> New Task -- > and copy paste the path of you adb.exe (space) devices to check for devices attached to your machine.
I am unable to start my android emulator in eclipse . I get hit with the following error message always
"Failed to start emulator: Cannot run program "/Users/anandmadhusoodanan/Desktop/Assignments/Spring-2012/Embedded_Systems_Programming/android-sdk-macosx//tools/emulator": error=1, Operation not permitted" where
"/Users/anandmadhusoodanan/Desktop/Assignments/Spring-2012/Embedded_Systems_Programming/android-sdk-macosx" is the path of my sdk.
I have tried re-installing the ADT plug-in, the sdk and even eclipse.
I am using Mac OS.
The # symbol indicates that there are extended attributes for the files in question. To verify the extended attributes applied to the files use:
ls -l#
You'll probably find (as I did) that there is a com.apple.quarantine attribute on the files which can be removed with:
xattr -dr com.apple.quarantine sdkFolder
Where sdkFolder should be replaced with the name of the folder you extracted the SDK to.
Check that you have execute permissions on the emulator
Try
$chmod 755 emulator