Eclipse startup hang, "Android SDK: resolving error markers" - android

I am aware that other people have tried to resolve this issue but have thus far found a suitable answer.
The error is, on start up, eclipse gets hung up on "Android SDK: resolving error markers" furthermore, if I try to interact with it, it freezes completely and I am forced to force quit.
This is the progress dialog:
I find it odd that it needs to resolve the error markers multiple times but I assume this is just for each project in my workspace.
this is my eclipse.ini:
Other things to note being that all that currently exists within my workspace is an Android Application, an App-engine endpoint project for the before application, and 4 needed referenced libraries. All mentioned projects are open. Is this a matter of me overloading the IDE or perhaps there is some loop I threw it into? I find it hard to imagine that this is a unique circumstance.
UPDATE:
When I delete the app engine endpoint project from the workspace and restart eclipse, it loads fine. When I bring it back in, all good. But when I restart from there, it goes into error loop again. I am convinced that I have a circular reference in there somewhere but I cant figure out where. Thanks for your help.

This problem made me crazy until I found below, if I didn't post the answer, I am not a man!
Hope this helps if you are also going crazy
I found from Eclipse Stuck at "Android SDK: Resolving error markers":
cd [my workspace folder]
cd .metadata
find . -name .markers -exec rm {} \;
eclipse -clean -refresh
if you are in win32
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S .markers') DO RMDIR /S /Q "%%G"

I solved the issue with this (from your eclipse folder):
eclipse -clean -refresh
I followed this url: http://tekhoow.blogspot.com.es/2013/06/eclipse-stuck-at-android-sdk-resolving.html (but the eclipse command was enough for me)
There is also another stack question with the same topic and say the same:
"Clean all projects in your workspace and restart Eclipse to solve this problem."
How to Resolving error markers Eclipse Android SDK

After trying all suggested ways, the only way solved my problem was deleting this file:
/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Original answer

I was having the same problem, and found the solution by going running "eclipse.exe -clean -refresh" from the cmd prompt. The above solution includes other commands done in the .metadata folder which doesn't apply to all versions of Eclipse. I am using Eclipse IDE for Android Developers 23.0.2.1259578.

There is a very simple way of invoking the above answers on Mac OSX:
cd workspace
rm ./.metadata/.plugins/org.eclipse.core.resources/.projects/*/.markers
(or)
rm ./.metadata/.plugins/org.eclipse.core.resources/.projects/Project-Name/.markers
cd eclipse.app/Contents/MacOS
./eclipse -clean -remove

This has happened to me before.There are errors in the libraries related to the Google App Engine project, what you need to do is close Eclipse, go to your workspace and move every other project not related to the Google App Engine project to another location on your computer, then start Eclipse and make sure you resolve all the issues with the backend project ,then copy the other projects back to your workspace.

figured it out a couple days ago and forgot to inform y'all.
all I needed to do was save the projects to some other directory if you have not already. Delete it from your workspace and also delete the app engine endpoints project.
Re-import the android project and copy into workspace. set the java build path and everything else (if it says 'project master' control click -> team -> disable) everything should look fine. Then, delete all references to the app engine project, this means folders called 'endpoint-libs/libcontainers...'
This will break your project everywhere you reference the data model
Now, re-import the app engine project and make any necessary changes so that it doesn't have build errors (warnings may be OK).
Control click -> generate cloud endpoint client library. The libraries in the original project will be replaced.
Not entirely sure what caused this but for the time being it has been working beautifully.

Great topic!!
After reading all answers. I have found a simple solution and It work fine on windows 7.
I created a file "eclipse_start.bat" with this simple command lines:
cd /d C:\eclipse (the directory where is the eclipse.exe file)
eclipse -clean -refresh
cmd
Every time i have to launch Eclipse simply I launch this file so the program start without problem.
I tried also another solution. I added this line in the file "eclipse.ini" before all other line
-clean
-refresh
In this way I can launch directly Eclispe with the same result but in a more cleaned way.
Thanks to everybody!

I have a simply solution without code. Stop the process "resolving error markers" using the red button, then uncheck Build Automatically (Project -> Build Automatically), close Eclipse and open it again. Check again Build Automatically.
Sometimes it happen again, then I do this same process. Boring, but it works.

Try go to workspace folder, in \workspace.metadata.plugins\org.eclipse.core.resources.projects
You will see folders with your projects. Open every folder and remove files ".markers". After restart Eclipse

To me, nothing helped but then I went to .metadata/.plugins/org.eclipse.core.runtime and deleted files:
com.android.ide.eclipse.adt.prefs
com.android.ide.eclipse.ddms.prefs
Eclipse started normally again.

I used the answer above - first installing cygwin to get the Unix style "find" installed (note that the DOSbox "cmd" version of "find" does not work - in the following line at the top of your Eclipse workspace that hangs:
find . -name .markers -print -exec rm -i {}
Note that the "-i" specifies "interactive" remove - and will confirm each ".markers" file that is to be removed. Then I followed this with a
./eclipse.exe -clean -refresh
in the eclipse folder. I will check again (after the next hang :-) to see if just the second line is all that is necessary. Anyway eclipse is happy again and so am I! Note that installing the full cygwin package takes a while (many hours) - but it is worth it - just start the install at the end of the day and let it run overnight...

go to the eclipse folder with cmd,(Shift+right click on eclipse folder and chose open with command promt)
then type "eclipse -clean -refresh "

You should delete the .marker file from your all project which is exist in .metadata.plugins\org.eclipse.core.resources.projects(your all project).

So on a Mac, with Eclipse ADT, the clean and refresh method did the trick for me. Here are some slight modifications:
Go to ADT Location (if Android) -> Eclipse.app -> MacOS
In this directory you should find eclipse.
Type the following command and you should be good to go:
./eclipse -clean -refresh

Create a text document in the Eclipse installation folder
Paste this command and update with your installation folder name
"C:\Folder where Eclipse is installed\eclipse\eclipse.exe" -clean -refresh
Rename to CleanEclipse.bat and run every time you have this issue
Will save you a lot of time!

I frequently facing this problem. And my final approach was..
First open TaskManager by pressing CTRL+ALT+DEL and delete all instance of adb.exe. if problem doesn't solve then go to next step without closing taskManager.
Close Eclipse and also check it shouldn't be running in TaskManager(also finish its process).Then Open %USERPROFILE%/ on Windows or simply ~ on Linux/OS X (You can locate this folder from the Desktop). then open .android folder and delete cache folder and ddms.cfg and start Eclipse. If still your problem doesn't solve follow.
If your problem doesn't solve by following above method then go to workspace folder and delete as suggested by this Answer
/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
If problem still doesn't solve then Pray to God.

Related

Error: Execution failed for task ':app:clean'. Unable to delete file

I'm trying to rebuild my Android Studio Gradle project (containing mostly Kotlin code), but it started to throw an UnableToDeleteFileException during the cleaning/rebuilding process:
Execution failed for task ':app:clean'.
> Unable to delete file: C:\Users\User\KotlinGameEngine\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.1\jars\classes.jar
This started happening after I tried to change my project's package structure. Unfortunately, I did it by renaming and moving the source folders rather than refactoring through Android Studio, which was a bad idea.
I've been searching for a solution to this problem all day, and these are the things I have tried to no avail:
Doing a Gradle sync;
Reinstalling Java JRE and Java SDK;
Reinstalling the latest version of Android Studio (1.4);
Rolling back to the previous AS version (1.3);
Invalidating the AS cache and restarting;
Deleting the gradle and .gradle directories in the project directory;
Deleting the .gradle directory in my user directory;
Running gradlew clean from the AS terminal;
Manually copying the sources over to a new project (weird that it somehow persists across projects...)
Things that I've tried with a little success, but only let me perform one more clean and rebuild before the error occurs again:
Closing AS, manually deleting the build files, and opening it again;
Killing the java.exe process while AS is running (this could technically be done every time, but it's tedious and slows down the build process)
So it seems that compile the Java process may put a lock on the build files for some reason, but it might also be something to do with Kotlin. I have a (more mature) Java Android project that I'm working on, though I can't reproduce this error when cleaning it. It seems to only happen to my Kotlin project.
Update:
I've found that the problem is being caused by the Kotlin Android plugin. The problem disappears when I remove apply plugin: 'kotlin-android' from the module's build.gradle file and comes back when I reinsert it. Feel free to offer any insight into this.
Update 2:
The last update isn't the cause. I found that if a project contains a Kotlin file then rebuilding and cleaning fails. It continues to fail, even if all the Kotlin files are removed, until the background Java process is killed, meaning it has some kind of lock on the build files. I submitted a bug here with more details and steps to reproduce the bug: KT-9440
I killed all the java TM processes in the task manager and it let me to rebuild
If you are using Android Studio 2.0 Beta, this issue might appear (more likely if you are working on NTFS filesystem) and it seems like the "Instant Run" is the culprit. Search for "Instant Run" in settings and uncheck the box.
I have filed an issue on the bug tracker.
Try
File -> Invalidate Caches and Restart
This worked for me
After I posted a bug report to the Kotlin bug tracker, I was notified of Issue 61300 on the AOSP tracker. That seems to be the cause. Since there's nothing I can do at the moment, I'll mark this question as answered, and I'll update the answer if the bug is fixed.
In the meantime, if you're running Windows, I believe I've found a workaround. You'll need to download LockHunter (at your own risk of course), then add the following to your module's gradle.build file, replacing the lockhunter variable with your path to LockHunter.exe:
task clean(type: Exec) {
ext.lockhunter = '\"C:\\LockHunter.exe\"'
def buildDir = file(new File("build"))
commandLine 'cmd', "$lockhunter", '/delete', '/silent', buildDir
}
This causes LockHunter to forcefully and silently unlock and delete the build files when the app:clean task runs.
Clean project from Terminal using this command gradlew clean.
I solved with command:
taskkill /F /IM java.exe
and then:
gradle assembleDebug
Deleting the directory intermediates is a quick fix for problem.
The directory will be rebuilt when the project is rebuilt.
I was facing same issue on Android Studio 2.2 preview 1, solution by #AndresSuarez was correct but for some reasons I couldn't find JAVA TM process in my task manager. So I tried the following solution and it worked -
Open command prompt and type TASKKILL /F /IM java.exe. This will kill all JAVA TM processes automatically. Now re-compile the app again, it will work.
Additionally, you can create a .bat file, add the above code in it and run it every time you face the issue.
I had the same problem and this worked for me:
close Android Studio.
delete intermediates directory (as long as Android Studio is opened, this directory can't be deleted)
open Android Studio again
I had this problem in Android Studio 2.3.
I simply restarted Android Studio and after that I could clean without complaints.
For me, this happened because of an active debugging process. So, before cleaning or rebuilding, make sure to kill all active processes. To nail down the success, execute Invalidate Caches/Restart.
For me, the culprit is adb holding onto the apk file since I utilise it to install and start the application on my physical device through command line.
So simply:
Task Manager > End process adb.exe
And then the file is free to be deleted and the project may be cleaned
I solved this one in my ubuntu like this.
Check for the processes running in your system(Ubuntu) like in task manager in windows.
Ubuntu terminal command to list out all processes running ----> "gnome-system-monitor"
Terminate or end the JAVA and ANDROID processes in the list.
Again start the studio and import project.
Its works for me without any problems. Hope this helps...
I thought this is the problem with the process that are already created and Duplicated.
The solution is quite easy.
This is one of the solution which worked for me.
It might be possible that your project's app/build/outputs/apk
folder is opened.
so just close this folder and rebuild your project. and it will be solved.
For me it helps when I Exit Android Studio, click one more time Clean Project (it appears the same error) and next click Make Project - after that of course Run 'app' button in Android Studio.
Find programs who used app/build/outputs/apk folder, then just delete folder.
I think Android Studio have to delete old apk folder before rebuilding.
For my case, I resolve it by -
First, close the app if it is running in the emulator.
Then run the command gradle --stop in the Terminal in Android studio.
Then clean project and rebuild project
As suggested in the bug report, uncommenting the line
idea.jars.nocopy=false
in the idea.properties file has solved the issue for me.
Note that this needs to be done every time Android Studio updates.
Some times intermediates creates problem so delete it and Rebuild project
OR
simply run cmd command - > gradlew clean
in your project folder in work space (its work for me)
In Android Studio 3.0, I had the same issue. This fixed it:
Close Studio
Delete projectRoot/build/ and projectRoot/app/build/
Restart Studio
react native devs
run
sudo cd android && ./gradlew clean
and if you want release apk
sudo cd android && ./gradlew assembleRelease
Hope it will help someone
i simply run cmd command - > gradlew clean , And it fix the issue
If you are testing with a local backend (java servlet on local google app engine) the running process blocks some files. So you are not able to live deploy. So in this case you can solve this by stopping the local backend before starting clean or build. You find the option under "Run -> Stop backend".
I had the same error, tried multiple ways but the solution worked for me was to delete build folders from /android and /android/app directories.
run react-native run-android worked for me.
I solved it by global searching the missing directory in the project. then delete any files containing that keyword. it can clean successfully after I remove all the build and .externalNativeBuild directories manually.
I had the same issue after moving my project from D: to G: drive
but disk checking solved my issue
I used chkdsk /f /r /x G:
**
here some command line switches were used:**
/F Fixes errors on the disk
/R Locates bad sectors and recovers readable information (implies /F)
/X Forces the volume to dismount first if necessary (implies /F) (important)
Note: /X is important because it will dismount the drive and you can manually delete the build directory of your project,
now rebuild the project
My Solution for this was very very simple ( if you are using Windows).
1- Close Android Studio.
2- Run Android Studio as Administrator.
3- That is it.
I just solved this exact problem for myself.
The problem was that somebody else had created the file so even though I have admin rights on the computer I was unable to make changes to the file or files. You need to go into the properties of the file or folder and change the ownership or add ownership. This web page explains it well step by step what you need to do.
Once I did the above, I found the file in file explorer and manually extracted it. I don't think it's needed in the android studio project if it was trying to delete it anyway.
Another application that can be using the resources is apparently Android Studio's Kotlin REPL. I closed that, and then I could build again no problem.
I have tried to remove all the Java services but still it is failing while executing the gradlew clean build command from IntelliJ terminal. I even verified the other applications I have opened somewhere the same path which I am trying the delete. But could not find any of such. So, finally restarted the IntelliJ IDE and able to proceed build smoothly.

Eclipse hangs at the Android SDK Content Loader

I've been working with Eclipse 4.2 (Juno release 20120920-0800) on OS X 10.8.2 for a few weeks now, building apps for Android 3.0 and above. I have a quad core i7 MacBook Pro with an SSD, so performance is not an issue. Everything was fine.
At some point I imported an Android project that required Android 2.2, so I installed that using the Android SDK manager (v.21). Ever since then, working with Eclipse takes forever. First of all, it will print the following in the status message at the bottom right:
Android SDK Content Loader: (0%)
This takes two minutes or so. The specific message is "Check Projects" and while it's doing that, all Android projects are highlighted in red, because the Android resources aren't found. Then, it proceeds with:
Loading data for Android 2.2 (100%)
This will stay for a couple of minutes. Then it goes on to do the same with Android 3.1 and other SDK versions I have installed. It basically hangs whenever the first autocompletion kicks in (e.g. after typing System.) or when I access the Android preferences before it has loaded.
Here's the state of my Android SDK:
What I've already tried:
Reinstalling the Android SDK (via Homebrew), thus deleting /usr/local/Cellar/android-sdk completely.
Reinstalling the AVD plugin (v.21) from scratch.
What can I do to find out about the source of these problems and get back to a nice and clean state?
This is the solution I found which works correctly:
Make sure that eclipse is not active. If it is active kill eclipse from the processes tab of the task manager
Open %USERPROFILE%/ on Windows or simply ~ on Linux/OS X (You can locate this folder from the Desktop)
Go to .android folder (This may be a hidden folder)
Delete the folder cache which is located inside .android folder
Delete the file ddms.cfg which is located inside .android folder
Start Eclipse
Hope that this will work for you.
Same problem, stuck at 0%. Ran
/Applications/eclipse/eclipse -clean
and everything worked great again. Modify that path for linux boxes.
Update (from the remark from #Janusz )
For mac users with eclipse outside application directory your clean command will looks similar to:
path/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean
Go to your workspace directory \workspace\.metadata\.plugins\org.eclipse.core.resources\.projects and delete all the projects in there.
Note: You are not going to lose your projects
I have used some other answers here to fix this problem but I came across it again recently, and none worked. I didn't want to re-install or delete my workspace, so I finally found one that did work that might help someone else. Delete the file:
/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
You can make a backup first, if you like. It stores your workbench settings (perspective state, file paths for menu options, etc.) But eclipse loaded and I didn't have to re-install anything like some answer suggest. And I haven't seen this anywhere.
I know that this has been resolved but I thought I would share this link:
Solution One
Often times, this problem can be network related. Check if your
network is behind a proxy. If so, you need to configure proxy
on Eclipse. For that, go to “Windows” -> “Preferences” -> “General” ->
“Network Connections”, and fill in your proxy info. Restart Eclipse
after that. Conversely, it’s also possible that you have configured
proxy on Eclipse before, but that you are no longer behind proxy. Make
sure to disable proxy then.
Solution Two
Another solution is to clean up project-specific meta data directories
which are stored under your workspace directory.
$ cd workspace/.metadata/.plugins/org.eclipse.core.resources/.projects
$ rm -rf *
Restart Eclipse.
Solution Three
Check if an adb process is running. If so, kill the adb process, and
restart Eclipse.
Solution Four
Try deleteing the contents of the cache folder located in user profile under .android\cache
Try deleteing the ddms.cfg located in user profile under .android
All the other solutions did not work for me so I simply deleted all the .log files inside the folder [workspace]/.metadata and it worked again!
It turns out this problem indeed occurs when your internet connection is flaky, slow, etc.
As soon as I got back to my normal internet connection, the content would load fine again, within less than a few seconds.
I have tried all the solution but i didn't get solution. After that i have disconnected Internet and deleted ddms.cfg from .android folder -> open eclipse -> dialog of statistics send to Google? -> Selected NO and Finally Worked for Me.
Edited:
I have tried eclipse -clean command in Command Prompt and that also worked for me.
Note: For eclipse -clean command first you have to select path of
eclipse folder where you have placed.
Thanks.
I'm on a Mac and using ADT, can confirm that the following worked for me.
cd workspace/.metadata/.plugins/org.eclipse.core.resources/.projects
rm -rf *
No amount of restarting the Eclipse, or rebooting the Mac was helpful. It seems that Eclipse gets into this stage because of stopping abruptly. I had to force boot my Mac and this issue seems to be happening since then.
My solution:
Install all the Docs in the sdk manager.
I prepared little script to make it easy dealing with this reoccuring and very annoying problem. Open Terminal, then:
open ~/.bash_profile
at the end of the file paste this function:
function eclipse-clean() {
echo "removing ddms.cfg file"
cd ~/.android/
rm ddms.cfg
echo "removing cache"
cd cache/
rm -rf *
echo "done! you can open eclipse now."
}
then all you have to do now is:
source ~/.bash_profile
and whenever you are stuck just type in Terminal window:
eclipse-clean
just right click on eclipse and run it as a administrator i was also having the same problem after this it was working fine actully sometimes the windows do not give the permission to access to sdk in normal user so you have to give admin permissions in order to work android sdk or content loader
this approach:
shut down eclipse then go to YourWorkSpace\.metadata\.plugins\org.eclipse.e4.workbench and remove "workbench.xmi", now restart eclipse.
I made this batch file to fullfill the task explained by slhck's answer for Windows systems:
#echo off
set ECLIPSEFOLDER=%CD%
cd /D %USERPROFILE%/.android
rd /s /q cache
del ddms.cfg /f
cd /D %ECLIPSEFOLDER%
eclipse -clean -refresh
exit
I explained such approach in this post on my blog.
All the above solutions didn't work for me.
In eclipse Under Problems Tab check errors-
You might see the unable to delete file and project path name.
Now Go to your workspace directory -
Check project.properties for all the project stated under problems tab and check
target=android-21
The target value is valid and exists in your android-sdk/platforms/ folder
In my case target=Google,Google-Api-16 was causing the issue. Replace that and it solved.
Worked! All I did was to open Terminal and typed:
cd documents/workspace/.metadata/.plugins
and then... typed
rm -rf
... in that .plugins category.
There are various reasons for this problem, and each have a different solution.
For a Linux environment, I made a alias to take care of most of these as they happened overtime. To have all of those in one place, you could try this:
Add the following in your ~/.bash_aliases file.
alias eclipse='rm -rf ~/.android/ddms.cfg;rm -rf ~/workspace/MyApps/.metadata/.plugins/org.eclipse.core.resources/.projects/*;mv ~/workspace/MyApps/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi ~/workspace/MyApps/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi.bkp;rm -rf ~/.android/cache/;cd ~/Desktop/adt-bundle-linux-x86_64-20140702/eclipse;nohup ./eclipse & cd -;'
Refresh source using source ~/.bash_aliases
Note:
~/workspace/MyApps is my workspace, you'll have to configure your's accordingly.
~/Desktop/adt-bundle-linux-x86_64-20140702/eclipse is the location of my eclipse executable,and you'll have to configure your's accordingly
So this is what got me working again:
Resolved the problems with the different versions related to android-support-v4.jar. They were mismatched which causes problems if projects are related anyway.
The second one is not that obvious: I restarted the IDE from the shell, providing the $ANDROID_SDK_HOME - Environment variable.
This got me a step further but the ide hangs on a different location.
Providing $ANDROID_HOME finally got me all the way up again.
BTW: After this procedure it was not necessary in following starts of the IDE to set the environment variables again.

Error with parsing Android sdk content and initializing java tooling in eclipse

Every time I open Eclipse, I get the following error messages:
Android SDK Content Loader:
parseSdkContent failed java.lang.NullPointerException
Initializing Java Tooling
An internal error occured during: "Initializing Java Tooling". java.lang.NullPointerException
Loading data for Android 2.2
Parsing Data for android-8 failed java.lang.NullPointerException
Loading data for Android 2.3.3
Parsing Data for android-10 failed java.lang.NullPointerException
Loading data for Google APIs (Google Inc.)
Parsing Data for Google Inc.: Google APIs:8 failed java.lang.NullPointerException
See link for screenshot:
http://i.stack.imgur.com/lhhQQ.png
(I am using OS X Lion, and Eclipse Helios)
First i read some posts saying that it was the AVD.ini file in the .android profile that was causing the trouble. I tried deleting all the entire .android profile folder as suggested in Android SDK Content Loader failing with NullPointerException. This didn't correct my problem.
I tried deleting the entire Android SDK folder, downloaded it again and installed a couple of Android versions through it. Still the same error messages...
To ensure that I didn't have any old plugins or something that were the issue, I uninstalled eclipse, downloaded it again and installed the Android plugin again. (So the plugin is up to date).
When I go into one of my Android projects, I get error messages on places where I acces resources by using the R file. Regular Java projects work fine, but all Android projects gets small red boxes with white crosses on them. I have been searching for a solution to this problem since yesterday, but at this point I'm completely qlueless and would appreciate any help I can get!
Close all open projects and exit Eclipse. Now you can open Eclipse without getting the error. Start opening your projects one by one to find which one causes the problem. This is most likely because you deleted a Device profile inside the AVD manager.
Do not delete all the full .metadata
Backup .metadata
delete only .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Observation : the projects folders are created
Further - if you are using svn/git/hg have code repository links it would be destroyed, so to reinstate
close eclipse
copy relevant projects from backup to merge with current projects in .metadata/.plugins/org.eclipse.core.resources/.project
restart eclipse
Downfall - sporadic fail error may occur (sync or something) - harmless
backagain
I encountered exactly the same issue this morning. This is a workspace related issue.
Solution 1
I looked into my .metadata and read .bak_number.log files . Some layouts failed to parse and my projects were out of sync with the file system.
So I deleted all the .bak_number.log files. Relaunch Eclipse and the whole worskspace should work again the way you left previously.
Solution 2
However if it's not due to out of sync with the file system. Change the workspace then import all the eclipse projects from the previous workspace.
Thanks the project.properties files , the dependencies are still kept.
PS : I should return to IntelliJ :)
first close your Eclipse
Go to your workspace and rename .metadata to tushmetadata and go to
tushmetadata- >.plugins -> org.eclipse.core.runtime -> .settings
and copy all files from it.
now open the Eclipse and go to your workspace there you can see the
newly generated .metadata folder in that go to .plugins ->
org.eclipse.core.runtime -> .settings and paste here and do not
overwrite any file.
Try to "Hello World" project and run it.
Try to delete file .metadata from your android workspace folder. .Metadata folder contains all configuration files for eclipse. It works for me.
Your answers might be right. What I did was to change my workspace. I redownloaded the project I was going to work on from git, and reimported it. Now it works fine :) Maybe there was some files in this project that made the error messages apear? Dunno....
I have remove the .metadata folder but after it, when I run the eclipse, I cannot creates any Android project. To solve it, I have done the follow:
Go to the main work directory of eclipse
Localize the folder com.android.ide.eclipse.adt It should be in .oldMetadata/.plugins/
Copy it to the new eclipse configuration: .metadata/plugins/
See the full solution here:
http://www.jiahaoliuliu.com/2011/06/running-android-sdk-in-eclipse-errors.html#solution4
For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer versions of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.
When I met this problem about a year ago, I had some projects in my workspace that needed a specific Android SDK level (let's say 2.1) and i didn't have it installed in the Android SDK.
slott's answer helped a lot. Deleting the .metadata or reinstalling eclipse didn't though. The trick was to isolate the project causing the problem, delete its .settings folder and .project file and reimport it.
I discovered another cause, where I'd added a space character into an otherwise blank line in the project.properties file. When I eventually ran android update project -p .
the program (android.exe) threw a NPE exception. When I deleted the space from the blank line the android update project command worked and eclipse started behaving (after running clean a few times).
This happened with r20 of the Android SDK on a Windows 7 64-bit machine.
FYI my change that fixed the problem in project.properties is public at http://code.google.com/p/android-daisy-epub-reader/source/detail?r=517
This is just weired.
In my case when I took a subversion update, I was getting this problem. The reason was the corruption of my project.properties file (due to subversion conflict).
I just corrected the file and problem got solved.
I found it's just missing project.properties file in the project folder. After copying one from another project the error is gone. The only valid line in project.properties is
target=android-8
If you are using SVN or GIT please check whether the project.properties has conflicts or not.
Sometimes project can not be open because of this.
I hope this is useful to someone and saves his/her time: My colleague was facing same issue and we did almost everything mentioned here, with no luck. In the end we changed the Android SDK version in the manifest file and it worked.
This solution worked for me.
Close Eclipse and delete all .markers inside your workspace folder.
Restart Eclipse (once I had to restart it twice, it hang on the first but worked on the second for no aparent reason).
Of course, it's always safe to back them up first.

Updating Android SDK: "A folder failed to be moved."

While trying to update my Android SDK I am encountering this error when trying to install this particular package:
How do I fix this?
This happens once in a while on my Windows SDK (even when I don't have any antivirus or similar programs running, execute the SDK-Manager as an administrator and so on).
I just update the tools by hand in this case. Which means close the SDK-Manager after the error and open the ANDROID_SDK\temp folder. There should be a zip named tools_R16.zip or similar (don't remember the exact name). Unzip that. You should end up with a tools folder. Copy all the files from this folder into ANDROID_SDK\tools. Overwrite when asked. And take a backup of the SDKs tools folder beforehand, just in case something explodes.
After that, start the SDK-Manager again. The tools version should be updated.
The problem seems to be that Eclipse, or even the SDK Manager itself, locks the folder. Running android.bat from the tools folder should do the trick.
If you launched the SDK Manager from Android Studio then all you need to do is close Android Studio.
I presumed the SDK Manager was a modal dialog that was part of Android Studio - not a separate program.
thanks. this is how I fixed it:
I updated the tools by hand in this case. Which means close the SDK-manager after the error and open the folder android-sdk-windows folder. Using LockHunter, unlock all programs from holding a lock on the android-sdk-windows\tools\ folder. http://lockhunter.com/?ver=&vertype=pro&sm=main_window_64
RENAME the android-sdk-windows\tools folder beforehand to tools_DELETEME
There should be a zip named android-sdk-windows\temp\tools_r19-windows.zip. open that, You should see a tools folder in it. Copy that tools folder to android-sdk-windows\tools
After that, start the SDK-manager again. The tools version should be updated.
When you install tools/softwares use SDK manager. But don't use it when update. Do right click -> Run as administrator on android-sdk-windows\tools\android.bat file for updating tools. Always try to run commands as Administrator specially on Windows Vista/7/8. That'll fix most of permission issues etc...
You probably started the SDK manager from eclipse? I encoutnered the same problem, and fixed it by manually opening the SDK manager from the directy tools.
My solution was to start it from within eclipse - as Administrator.
well i had the same issue on windows 7 ... problem is that during the update it tries to rename the tools folder (inside the SDK folder) and that folder is used by a process "ADB" which is currently running ...
so you cannot do the update smoothly until you stop / kill that process ...
BTW copy pasting the new contents of tools folder from the temp would also work ...
With windows 7, when "failed to install popup" appears kill the process called adb (from task manager ctrl+alt+del) then press "Yes" and stuff is being installed.
I tried running android.bat and got the same error.
What worked for me was using unlocker to unlock the \tools folder.
Ensure you don't have any essential files or folder opened/being used by other applications including explorer.
I've read before, people take a copy of the platform-tools folder and run the update from a different location. This ensures you haven't got open the files it's trying to update.
Could also disable your antivirus for 5 minutes o0o0.
On Windows 7 and probably Vista, run Eclipse as administrator.
My problem was Windows 7 security. I opened up the security on C:\Program Files\Android to EVERYONE with FULL access and it then worked. I then removed EVERYONE after the update was complete.
I had to make a copy of the tools folder itself (keeping it at the same directory tree
level, thus "tools" and "tools-copy" were both in the "android-sdk-windows" folder).
Then ran Android.bat from that copy.
After the update just delete the tools-copy folder.
The error message was Failed to rename directory C:\devtools\android-sdk\system-images\android-21\google_apis\x86 to C:\devtools\android-sdk\temp\SystemImagePackage.old01. I deleted the C:\devtools\android-sdk\temp\SystemImagePackage.old01 directory by hand (it was a leftover? I don't know) and it was able to proceed.
Same error i got while updating sdk. It is because of targeted folder locked (access permission is denied).
You can resolve it as follows in "Ubuntu" :-
Press ALT + F2 and type 'gksudo nautilus' and navigate to the targeted folder like tools or extras and give create and delete permission.
then update, every thing will be working fine :)
First make a copy of tools folder in same directory (android-sdk or android-sdk-windows) then delete the original tools folder and then open the android.bat file by double clicking in tools-copy folder to launch sdk manager and install the tools.
If tools folder is not being deleted then use the unlocker LockHunter to delete the folder and then open android.bat to update the tools.
After successful installation of tools delete the tools-copy folder.
Close Eclipse or Android Studio if open.
It worked for me!!!
On my PC it was caused by monitor.exe running in the background. Terminating that proces solved the problem.
Close the currently launched android studio window from task manager by going to the studioprocess (So when closed there are currently no active studio windows). Then go to Android studio in windows explorer, select the studio64/studio(if 32 bit OS) and right click and select run as administrator.
In one line - you need to run Android Studio as a administrator.
These are the steps followed by me.
Restart the computer.
Open "C:\android\androidStudio\sdk\tools\android.bat" as admin.
Now install packages should run fine.
I know this is an old post but I want to write my personal solution to the problem:
Failed to rename directory C:\android-sdk\tools to C:\android-sdk\temp\ToolPackage.old01.
Obviously I have had the same issue and every time the Android tools needs to be updated it's a nightmare.
None of the solutions I found googling the net worked for me up now, but this is a vital job to maintain Android SDK updated. So I started to find an alternative working way to solve this issue and I found it finally.... at least... it works for me, even if it is a bit tricky.
The basic problem is that the android.bat batch file comes from the ~\tools\ folder and it's still in memory (running) while the same ~\tools\ folder needs to be updated (in our case, renamed).
The problem is that the android.bat runs java to launch swt.jar (the SDK tool), and it remains uselessly waiting for completion of this java program.
You can edit the android.bat and see the call in the latest row of this batch:
call "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
The problem is the "call" CMD command. It waits for the called external program completion.
But ther's another way to run external programs from a batch file: the "start" command. It launches an external program and terminates.
So I just replaced the "call" command with "start", so that after the change the latest row of my android.bat was:
start "" "%java_exe% %REMOTE_DEBUG%" "-Dcom.android.sdkmanager.toolsdir=%tools_dir%" "-Dcom.android.sdkmanager.workdir=%work_dir%" -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
Note: Keep the "" in between start and the application path. You can add text in those hyphens and this text will be the caption of the java.exe command window you will see after the changes. In my case I left the caption as an empty string but you can write there what you want.
After the changes, you can start the SDK and the android.bat will be no more waiting, leaving the SDK tool free to play (and rename the ~\tools\ folder without headaches).
Obviously, after updating the SDK tools, you have to redo the same changes in the new, updated android.bat batch file. This could be a bit unconfortable, but you'll have just to remember to make the changes before running the SDK tool and you'll have no other headaches while updating Android.
In Ubuntu following solved issue for me
cd [tools/directory/path]
sudo ./android
Solved this on my side by killing the adb.exe in Task Manager.
I just stopped the emulator, and problem was solved.

Android SDK Content Loader failing with NullPointerException

I've just recently started getting an error any time I interact with the Android SDK and AVD Manager in Eclipse Helios
I've tried reinstalling the Eclipse plugin and the Android SDK but to no avail.
If I go to the "Installed packages" page and click refresh (or install or remove a package) I get a popup box saying that
'Android SDK Content Loader' has encountered a problem.
parseSdkContent failed
java.lang.NullPointerException.
Here is the full log:
Stack Trace
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadTarget(Unknown Source)
at com.android.ide.eclipse.adt.AdtPlugin$10.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Session Data
eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product
Has anyone else encountered this recently?
It doesn't seem to be affecting actual Android development but its just kinda annoying.
The issue is in the your-avd-name.ini that is located at ...\<user-profile>\.android on your Windows machine (if you're Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).
This information was posted here: http://community.developer.motorola.com/t5/MOTODEV-Studio-for-Android/Android-SDK-Content-Loader-has-encountered-a-problem/td-p/6565
I solved the problem by deleting the .android directory in my user profile.
Solution:
Step 1. Find the folder named: > .android
This folder can be located in your Windows user directory, for example in Windows 7/8:
C:\Users\YOUR_WINDOWS_USERNAME.android
Step 2. Delete this folder .android
Step 3. Restart Eclipse and it is OK now
I solved the problem by deleting the .metadata folder from workspace
Go to C:/Users/<profile-name>/.avd and delete the .ini file of the AVD..Restart Eclipse..
otherwise if you don't know what file to delete or the above solution did not work for you, delete the entire created AVD folder..and restart eclipse..
The issue is in the your-avd-name.ini (config files) that is located at .android (search it)on your Windows machine (if you’re Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).
Try to delete .android folder from
C:\Users\Your User Name\.android
and open your eclipse and follow this Structure to configure your SDK for either installing new SDK or from installed one
I believe the trouble was with your ADT tools. If you had run eclipse plugin updates (which would update ADT), problem would have solved.
I get this parseSdkContent failed problem sometimes when I select improper values for a virtual device, if that improper value results in a blue screen of death upon AVD launch: After the crash when the computer restarts the "parseSdkContent failed" error will come when starting Eclipse.
This will give you all sorts of errors that does NOT at all give you any clue to the problem, from all the errors you may be tempted to reinstall Eclipse or even Java, but dont do that, it could be much simpler.
The solution for me is pretty simple: delete your .avd folder and the .ini file in ..Users\.android folder.
Backing up your AVD is therefore a good idea since it becomes corrupted if it crashes with Besod during launch.
Ok I've no idea exactly what I did but I used the standalone AVD manager (/tools/android from the command line) and un-installed most apart from the "Android SDK Tools, revision 2".
And then reinstalled the parts I wanted and the error seems to have gone away..
Confused!
For some reasons my sdk/addons and sdk/platforms directories got corrupted and unreadable (computer crash), this caused my "'Android SDK Content Loader' has encountered a problem." error.
Had to delete/rename the entire sdk folder, download and install the sdk+packages again. In user/.android everything was fine.
For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer versions of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.
First start the emulator from command line
emulator -avd yourDeviceName
after doing above step in my case eclipse started fine.
UPDATE:
There is no perfect solution to this problem other than starting all over again. The issue is still open.
My solution was simply to go to help->look for updates-> and install all android related updates. Once done, I restarted Eclipse, it told me I need to start the SDK Manager to update some stuff, I clicked the "Open SDK Manager" button it shows me, updated the dev tools, platform tools, added some latest APIs and viola, all is fine :)
just try to delete the avd folder inside the .android folder, which may also have ur sdk folder in the path. Just delete the avd folder and try to configure ur path of the sdk in the eclipse > preference > android. then try to configure ur new avd in the eclipse by clicking the avd manager and then adding a new avd with a new name and click the start.
Ur new avd device will launch.
Cheers
Prakash
I have deleted the .android for windows user.
if adb running stop it by adb kill-server and then delete the folder.
this worked for me I am using adt-bundle-windows-x86 on window 7.
the issue is with AVD. AVD are saved under .android folder so after new installation of adt-bundle-windows-x86 we need to delete this folder also.
I'm on Windows 7; I got this error on first startup of ADT-provided Eclipse. My particular variant referenced an inability to write to a location on my C: drive. I solved it using the .metadata trick from above; then I chose "Run as Administrator" and everything worked fine after that.
i have solved the problem by deleting the newly created AVD(Android Virtual Device) in "C:\Users\EAST.android\avd" where \EAST is my user name, in avd folder you will find two folders for each device e.g. myDevice.avd and myDevice.ini delete both the files and run you eclipse again
Solved this by deleting metadata and .Android
in workspace
Add following lines to .bashrc file.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
replace "~/android-sdk-linux" with path where you have saved the sdk folder.
This is a workaround (not exactly the solution). In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors".
I am sure this might work for you .
Had a similar problem. From one day to another I wasn't able to start my (so far) well working App. "SDK Content Loader" and "NullPointerException" Errors would pop up.
Read the Answers here but didn't want to delete my .android or .metadata.
I tried to clean my Project and - tadaa - it worked.
So, before you start deleting your plugins and stuff. Try a clean or restart and clean.
Maybe this will already fix your issue. ;)

Categories

Resources