Eclipse "Permission denied" error when trying to launch app - java

I'm trying to get started creating some apps for Android but I keep running into this Eclipse error:
NAND: could not read
file...android-sdk_r07-windows\android-sdk-windows/platforms\android-7\images/system.img,
Permission denied.
Do you think I should delete the package and re-install? I'm wondering whether it could be a corrupted file, although it says "permission denied" which makes me think not so. I just installed the plugin for Eclipse and created my emulator but I can't run because of this error.
I have googled searched this and could not find a relevant answer. Any help would be greatly appreciated. :)

This looks like file locking in windows. I will download unlocker for windows and check for processes that have lock on the folder you mentioned. What happens when you run emulator in the command line?

The file seems to be locked or otherwise could not be read.
First you could try to run Eclipse as an Administrator (especially if you are running Windows 7, which has stricter file access than XP).
May I suggest that you download Process Explorer http://technet.microsoft.com/en-us/sysinternals/bb896653 and hit Control-F to search for system.img. Then you'll probably find which process is locking up your file. You can kill the handle in the bottom view of process explorer.
If all else fails you can reinstall Eclipse and/or ADT from scratch. Good luck!

I suggest you to log in as a administrator if you are using Windows 7. When you open Eclipse, right-click on the Eclipse icon and select Run as Administrator.

I suggest reading developer.android.com - the section about SDK, ADT is not so big. And then maybe reinstalling the SDK step by step.

The documentation on the Android Developers Site is very helpful. It couldn't hurt to uninstall the SDK and then try a reinstall closely following the directions given on the above link.

dude you should get the latest sdk version.
also you can try checking if your user has full permissions on the sdk fodler as well as eclipse workspace

has same problem. Solved when i changed target from Android to Google API

Related

android.bat not opening Android SDK manager

Yes, this question has been asked before. But the solutions on the internet are not working so that's why I am asking it here. I'm guessing the solutions aren't working because I am using newer versions but I'm not sure.
Bit of Background: So I am making a small game in Unity. I have to test it on Android so I can check if there are any problems or not. So I check around the internet on how I may be able to do that. Turns out, I need to change the build settings to android and I also need JDK installed on my computer along with Android SDK Manager so I download them both. I did not install the Android Studio but just the Command Line Tools because many tutorials say that I do not actually need the whole Android Studio because I'm gonna be making the app in Unity not in Android Studio. So I do that. I install JDK and Extract the command line tools.
I think the JDK installed fine because after installing JDK, I opened Internet Explorer (No, I don't use IE, I use Chrome but I opened it just for fun). And a little notification showed up at the bottom which basically said that I could now run Java on the browser so that's why I don't think there are any problems with the JDK installation.
Problem: I extracted Command Line tools of Android Studio and found that there was only a tools/ folder in it. I opened it and clicked on android.bat but the Android SDK manager doesn't work. A CMD screen just flashes for a moment but then nothing happens.
Solution I have Tried:
Change set java_exe to:
set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
and delete the line:
call libjava_find.bat
But I can't find set java_exe code anywhere in the file. The file doesn't have it. How am I supposed to change it?
Alright, so I figured it out but I was still unable to pinpoint the problem. Here is what I did:
Installed a fresh copy of Windows 10. Note: It is highly unlikely that this will solve the problem. But where I live, it is very common to just install a fresh copy of windows whenever you get a problem. I really don't think you need to do this.
Follow all the instructions from: https://www.youtube.com/watch?v=yLFBu-VlBIw
If you get the following error:
Error building Player: CommandInvokationFailure: Unable to list target platforms. Then use this fix: not finding android sdk (Unity)
These steps solved the problem for me and I was able to run it properly.

Unable to save settings : IntelliJ IDEA

I use IntelliJ IDEA 15 and have a problem with the auto-saving. For example I make a new configuration, e.g. Show the line number. When I close IntelliJ and reopen my IDE, it doesn't save my configuration and shows me this message:
Unable to save settings : Failed to save settings . Please restart IntelliJ IDEA
I get this too (IntelliJ 15.0.5), but only when the "Markdown support" plugin is used. Once a .md file is visualised the error starts appearing.
For future reference current version: 2016.1.20160405.143
Not a very solution-oriented post, but maybe this can help someone further pinpoint the source of the error.
This workaround allows you continue using "Markdown Support".
Uninstall the latest version of "Markdown Support" and install version "8.0.0.20160127.143.1" from https://plugins.jetbrains.com/plugin/7793?pr=idea. Everything works fine.
I was receiving the error with:
IntelliJ v15.0.6
"Markdown support" plugin version 2016.1.20160405.143
I uninstalled the Markdown support plugin (IntelliJ IDEA > Preferences... > Plugins > Markdown support), restarted IntelliJ, and am now able to save without error.
I have tried everything from this SO thread but it did not work. I solved it by deleting the .idea folder from my project's Windows path and then restarting intellij.
This can also happen when the disk drive where the currently opened project is stored is full (0 bytes left on device). The system tries to write to the .idea folder but cannot, so it gives the same error as if there were no access rights.
This happened to me as there was a process writing to disk in the background until it was full.
I delete this file : .IntelliJIdea
When I launch ./idea I should reconfigure all IntelliJ system (config/ extention/ theme/ licence ...)
So It's okay now but I think is not a good solution ...
Workaround for Windows users.
My installation is located in:
"C:\Program Files\JetBrains\phpstorm"
The location gives it problems with the saving of files. (probably to do with user rights and UAC, not totally figured out what rights the folder needs, but for easy resolving I removed and reinstalled Phpstorm to
"C:\development\phpstorm" and it resolved the issue.
For those who have a simular issue on windows machines:
I have applied the "hidden" property for the .[IntelliJ-Produkt][Version] folder in Users/[Username] folder. This was causing the issue. Don't do that.
I encountered this problem when I open up IDEA for the first time after copying the old config files backed up with my Live CD USB before reinstalling my Ubuntu. I think it is because I copied the files from the old OS and to the new OS as root, so the ownership of the folder is changed. Now when I want to write to it as another user, it blocks me from doing it.
Change the ownership to your user and change permission to add write solves it. You use chown and chmod.
On OSX, I've uninstalled PhpStorm, and then have installed it again, always by using the JetBrains TOOLBOX.
Hope it helps!
Windows Defender was the issue
Windows defender has a protection component called ransomware protection (details: https://www.makeuseof.com/tag/protect-ransomware-windows-defender/)
This restricts folder access (for selected folders) to some programs only.
Add Webstorm to allowed applications
Excerpt is below. Full guide with pictures are here: https://www.windowscentral.com/how-allow-blocked-apps-ransomware-protection-windows-10-october-2018-update
Open Windows Security.
Click on Virus & threat protection.
Under "Ransomware protection," click the Manage ransomware protection option.
Click the Allow an app through Controlled folder access option.
Click the Add an allowed app button.
Click the Recently blocked apps option.
Click the + (plus) button for the app you trust and want to allow.
Click the Close button.
I faced the same issue today and it might help some people if above solutions cant help. I am using dual boot system. Win 8 and Kubuntu. I got this problem with my intellij installed in Kubuntu. I realized my project was in a NTFS partition which was marked as READ ONLY. This happens sometimes when you shutdown windows and start computer into your linux.
Solution is to go back to your windows OS and restart it and switch to linux. Also, you could hold shift and press shutdown button, then choose to turn of your pc in the blue menu.
On windows 10 I had the same problem, I ran PhpStorm as administrator which fixed permission issues it had.
Then I restarted PhpStorm without administrator permissions and everything worked fine.
It was a fresh install so no plugins other then the build in ones.
I've encountered this issue multiple times; rebooting my (windows) computer has always worked for me (while restarting Intellij didn't do anything).
It's because you don't have permission to save settings. On my macOS, I set write permission of my project.
I got same error message for InteliJ WebStrorm saying
Unable to save settings
Failed to save settings. Please restart WebStorm
It happened due to permission issue. if you don't have permission to save this message could pop-up. Please make sure you have write permission to the folder you are saving.
I might be late at answering this but I did not see any accepted answers here.
I got a solution to this on other forum.
They suggested to start IntelliJ IDEA as Administrator.
It worked for me.
Hope it helps people who come here searching for answers.
for my Ubuntu, i fixed it by issuing this command.
sudo chmod 777 /path/to/dir

AVD Manager can't find tools\android.bat even though it's there

I've researched this on the internet so much and nothing I find is helping me out. I got the SDK manager to run, but when I try to run the Adroid AVD Manager, it doesn't run!!!!! Why?
It says, word for word,
"Failed to execute tools\android.bat:
The system cannot find the file specified."
Why can it not find a file that is clearly where it is looking?
PS I'm running windows 8, installed the latest version of the ADK.
The latest SDK has AVD Manager in the SDK Manager itself. Open SDK Manager -> Tools -> Manage AVDs
I was getting the same error and solved it by going to the tools folder (up one level in my case) and then running the android.bat file.
This then runs the SDK Manager and then follow Samarth Jain's answer above.
Make sure you have the sdk/add-ons folder. I created that and SDK and AVD Managers both worked correctly
I just copied sdk manager.exe and avd manager.exe from ..sdk\tools\lib to ..sdk
You may not have the correct permission level to run the program.
Try doing the following:
Right click
Run as administrator
The beat and working way to solve this problem is to download the ARM EABI v7a system image for your respective API level and also the Intel x86 Emulator Accelerator(HAXM installer). After that you can run the AVD manager from the SDK manager and now select the ARM system image in the CPU section and now thw OK button will work. It worked for me and hope will work for you.

Plug-in com.android.ide.eclipse.adt was unable to load class android

I am new to android development
My eclipse was working properly. But now when I start a new project it give an error
Problem opening wizard
The selected wizard could not be opened
The Detailed error message is
The selected wizard could not be started.
Plug-in com.android.ide.eclipse.adt was unable to load class com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizard.
An error occurred while automatically activating bundle com.android.ide.eclipse.adt (239).
I can't run existing Android project also.But I can start a new java project and run.
Why this is happening
If you have not added ADT then do the Following steps.
Help -> Add New Software -> Add.
In Name option write ADT
And if you have installed ADT in your Computer then add its path in Location like
jar:file:/D:/ADT-16.0.1.zip!/
And then ADT will install.
And if there is a problem try to remove that adt and install again.
1) remove the ADT repo (Window->Preferences->Install/Updates->Available Software Sites)
2) add Indigo repo ("http://download.eclipse.org/releases/indigo")
3) run updates
4) add ADT repo again and install
For me,what seemed to work was:
1.Restarting the application
2.(Or) Restarting the computer
I still had some problems.Some projects dint load.I'm not sure what the problem is or was.I think reinstalling ADT should do the trick.
Actually it is not necessary to uninstall the ADT plugin. Just add this repo(http://download.eclipse.org/releases/indigo) and then help->check for updates
I have been having a similar problem, and it seems to be the org.eclipse.objectteams plugin causing the trouble for me. What I needed to do was remove the plugin from my Eclipse plugin directory as follows:
mv ~/.eclipse/*/plugins/org.eclipse.objectteams* ~/someDIR
There seems to be dependency issues with the newer versions of Eclipse. Sorry if I can't provide more information.
Maybe see https://bugs.eclipse.org/bugs/show_bug.cgi?id=350133.
You will also get this fault if you have an AVD running. Close the AVD and restart eclipse
Am posting this answer for the people who is referring this post in future.
The methods that all mentioned will take more time. I have figured out this problem by updating plugin.
But it is not like the way as vic12 is mentioned. I have done this in the following way
Help > Install new software > click on link What is already installed you can see a list of installed software. You can choose and update any one as you want. If you click check for update it will update all the software that we installed it will take a lot of time. By this way you can update the one that you want. This can be done in a minute. it saves time.
In my case computer restart resolved all the issues without re-installing ADT plugin.
BTW, I am using MAC + ADT_v22
Go to Help - eclipse market place - search for adt. Then update or install it. This worked for me.
I had same problem and I have started to read answers above. then I stopped to read and just restarted eclipse and it is worked for me! (this is my first solution for all electronic devices and generally works :)
This can occur if you remove Android from your build path. Just try to relink JRE6 or 7 and restart the program. Eclipse will handle it for you.
I got this problem solved when I restarted Eclipse and changed the workspace am working on.
You can try changing the workspace too. It worked for me!
If you are on a Mac and user Eclipse ADT, go to ADT -> Preferences -> Android. There you should find an option for setting your Android SDK location. Simply browse for the existing ADT, and select the SDK folder.
This of course can only be done after the SDK has been installed.
Just restart the eclipse. It seems eclipse is having some bug which is leading other components from proper loading. Or first of all start sdk manager from background and then eclipse.
Simple:
This is work for me. Please follow these steps.
GO To:
Help>>Install New Software>>Available Software Sites
then Locate for:
http://download.eclipse.org/releases/indigo
If available then just select and reload
Else
ADD >> Location past this url in
http://download.eclipse.org/releases/indigo ">>OK Then >> Reload
Hope this help somebody .
Enter the variable 'PATH' the path of the JRE folder (java).
I hope that would help somebody:
I had the same problem and ironically the problem was in a simple code error. For some reason this error caused Eclipse to overreact with red lines all across the code and saving errors as well as the error mentioned in this post.
I fixed the problem (deleting an extra }) and all problems disappeared.
I don't know why Eclipse overreacted this time, but it's another option to check before you install, uninstall or update anything.
Good luck.
I just want to add this in here as the problem just occured with me. What I did was close eclipse, reopen it and then it started working. If this doesn't fix the issue then I advise you go with #Bhavin's answer.
You might have stored two ADT plugins one with link and other with zip file you have to delete one of them
Help -> Install new software -> Available software for sites -> and remove one of adt plugins.

Error launching first test application: Android Packaging Problem?

Conversion to Dalvik format failed: Unable to execute dex:
wrapper was not properly loaded first
[project]
Android Packaging Problem
I've never worked with Java or eclipse before, I'm following this introductory guide and all searches via google return no helpful results. I'm guessing the problem is I have built Android stuff with eclipse properly but I have no idea, I followed this guide to the letter and everything went as it explains it should.
Any ideas what caused this problem, or is it specific to the guide? If so I'll post on their help page.
I have tried doing project -> source -> clean up, but that didn't fix anything.
Edit:
I went to Project -> Android tools -> Dex bytecode and it reported:
DexDump: missing classex.dex for project. Please compile first.
So I guess that's my problem! Not sure how to solve though.
Go to Project -> Clean
It will rebuilt workspace and fix the errors if any.
As I said, I had the same problem so I tried all the different versions and
then I stopped filling in the SDK-version number
and finally it did not complain anymore about the wrapper.
After that it was totally fine to write the SDK-version when I created new projects.
Hope it works out for you too.
Had the same problem (running on Windows 7). I resolved it by running Eclipse with Administrator privileges.
try to run eclipse under administrator permission. Problem may be resolve.
I think you installed the SDK in "Program Files" folder . So for do something inside, must have administrator permission.
One thing that may help is to create a new test Android project.
In Eclipse, select File → New → Android Project.
Set the project name to "Test3", check Android 2.3 for the build target, type "com.example.android.apps.test3" for the package name, and type "Test3Activity" in the "Create Activity:" text box. The form should look like:
Click Finish.
Expand the entry for "Test3" in the Package Explorer. Navigate to res/values/strings.xml. Double click on the entry for strings.xml:
Set the text content of the string element having name "app_name" to "Test3":
Right click on "Test3" in the Package Explorer and select Run As → Android Application. The emulator should open and after a long while, you should see:
If these steps do not work, then you probably have an error in your installation.
Try it out and let me know.
I had the same problem earlier today. Google was largely unhelpful.
I fixed it by removing the project from eclipse, then re-importing it.
According to this bug report the problem is caused by upgrading to version 9 of the SDK.
Had the same HelloWorld problem with Ubuntu 64 Lucid / Eclipse 3.5.2 from Ubuntu repository. Restarting Eclipse did the trick, though I notice it still fusses about API level requirement when HelloWorld is run.
Running it as Administrator has solved this issue for me..
Had the same problem - occurred after I tried downloading Android platform v2.3.3 (was using 3.1 and 3.2 earlier) and it interrupted in the middle - restarted eclipse and cleaned all projects and rebuilt and the problem went away
At what point in this tutorial/guide are you running into this problem and did you make sure to include your package information in each file or ie com.something.somethingelse at the top of your class or classes?
Perhaps a registry error or maybe even a problem with activity implementation.
Please post your code if this did not start you in the right direction.
Here are a few things to check:
Make sure you have the latest version oF Eclipse (Helios)
Make sure that you have the Android SDK plug-in for Eclipse.
Now if you have done that... Make sure that any classes you add (Each screen you view on Android is a class and is called an Activity) are in your androidmanifext.xml file See http://wrenbjor.com/2011/01/12/the-androidmanifest-xml-file/ for help on understanding this process.
otherwise make sure there are no red x's in your code or it wont work.
If you still have problems post some code and we can try to help.
Had the exact same problem the other night. Upgraded to Helios (3.6) and it went away, quite possibly as a side-effect.
Under windows 7, rather than run eclipse as an admin, change the permissions on the eclipse folder so the creator/owner has full control, and do the same with the folder the android SDK is installed into.
I had installed Eclipse using the files provided by Windows' native ZIP extractor. I deleted the files and took them from 7-Zip instead. Now the error is gone. So maybe using another ZIP extraction tool will help.
Recently got this when failing upgrade using adb-manager with eclipse open (win32). As eclipse was open, upgrade failed. Then returning to my project this problem occured.
Was solved by closing eclipse, restart as administrator and cleaned project.
I had the same problem but I resolved it using following steps(using eclipse helios and windows XP ) :-
Right click on eclipse.exe.
click on Run As...
Uncheck the checkbox before "protect my computer from unauthorized activity".
And it is running for me as expected !
hope it will also run for you.

Categories