I am using Android SDK Tools 23.0.2 with Android API 20 (L preview).
I have been having this error for some time:
parseSdkContent failed
.androidjava.lang.ExceptionInInitializerError
and I have looked at many other similar questions and tried their solutions to no avail.
They recommended deleting the /.android file in the user directory where my workspace is saved and restarting Eclipse. However this did not work for me.
parseSdkContent failed Could not initialize class android.graphics.Typeface
Android SDK Content Loader failing with NullPointerException
This error seems to be affecting my java code's ability to recognize the XML files it references. When I reference variables to components in the XML file, it does not recognize its existence, even though everything seems to be set up correctly.
Please let me know if any more information is needed.
I'd add a comment, but my rep isn't high enough...
Anyway, deleting .android folder worked for me. Your wording suggests you deleted then restarted Eclipse. Try:
Stop/Exit out of Eclipse
Delete .android
Restart Eclipse
I was using the 64 bit version of Eclipse ADT from this link https://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip
and it was giving me issues on Windows 7 64 bit
I have now downloaded 32 bit version of Eclipse ADT from this link https://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip
and now its working perfectly.
It might help others too.
I used the "switch workspace" option and created a completely new workspace. This new workspace gives me no problems.
I'd add a comment, but my rep isn't high enough... (just copied and paste here)
I was in the same problem and using Eclipse Luna + ADT Plugin, what I did was:
Exit Eclipse.
Delete .android folder from my home directory.
Delete .metadata folder from my workspace directory.
Also in my workspace deleted a folder called .remote (I don't remember exactly what was it's name, just deleted it).
Open eclipse, complete the ADT dialog, setup the Android SDK path, and check for eclipse updates.
If updates were done better you restart Eclipse before continuing.
Import my existing projects, (or create a new one).
Open a layout file (xml) to see if the error is gone.
Good luck!
Related
I've been getting this error message when I want to create a new project in NetBeans. There are two old answers for this question, Project Folder already exists and is not empty- Error in netbeans and Netbeans error: Project Folder already exists and is not empty. Not only they are addressed for NetBeans 7, but also they didn't work.
I tried:
deleting project directory,
deleting userdir under C:\Users..\AppData\Roaming\NetBeans,
deleting cache under C:\Users..\AppData\Local\NetBeans,
uninstalling and installing 8.0.2
updating JDK to 8.40
but none of them worked!
I really appreciate if you'd suggest a solution. Thanks already!
SOLVED: I uninstalled NetBeans from C directory and installed it to the D directory. Then while creating a new project I choose a directory under D. It works fine now!
There is a 99% chance that this is caused by your antivirus application.
You can check on allow file modification for NetBeans in your antivirus application.
I have Bit-defender total security 2018, so if you have it follow me:
Open Bit-defender
On protection tab click on (View features >)
Either you disable (Safe Files) or allow access for NetBeans.
By the way I think Bit-defender is blocking applications to access files on the C drive if I'm not mistaken, so that's probably why it worked for you when you put it on the D drive...
Go to Program Files, delete the NetBeans folder and reinstall it.
Go to C:\Program Files (x86) and delete NetBeans Folder And try to install it again
This might be because of your antivirus. I got the same problem sometime back.
I then switched off the DataLocker option in my antivirus app, after this the problem didn't recur.
I had the same problem when i was messing around with some templates, after undoing the edits and saving the error message stopped occurring.
When netbeans says project folder already exists, it isn't a total error. It still creates the project, it just ran into an error while re-creating one of the template files. If you have the original tab still open, all you have to do is undo to the point before you ruined some template.
Uninstalling and re-installing will fix the problem but i hope this knowledge helps.
I often randomly receive "R can not be resolved variable" errors, and when it happens I can never fix them unless I create a new project and copy and paste all the code. I think this shows that these are not errors from my code. I have cleaned the projects, restarted eclipse, my computer, and even reinstalled Eclipse, but none of those work.
I Have noticed that the gen file (Generated auto file) does not contain any file. I have not deleted them my self and this has frequently happened before.
I know that many people has posted questions on this topics but they have never worked for me and they usually receive low rating so not many people comments on them either. Also if it requires cmd or terminal, please give the commands for Windows, Linux/Mac. I use Mac. I have recently installed GooglePlayService in the SDK although it worked after I installed it.
I am very sorry for lack of useful information, as I have no idea what the issue is.
Here are some of my screen shots to show MainActivity.java, Package explorer and res.values.strings.xml.
I apologize for describing the situation in a confusing way but I tried my best, please tell me what you find confusing if you do find this confusing.
Aftr all Thank You Very Much!!!
Your "gen" folder is empty. It should contain R.java
[1]
Try this:
-Right click your project
-Select properties
-Select Java Build Path
-Click add Folder
-Select the gen folder
-Click OK
[2]
if [1] doesn't work
Check your Res folder for any errors in your XML files, if one of the files has errors, then the R file will not be built
This error was caused by a bug on the Eclipse where even, if you click on re-build it does not regenerate the resource file.
To fix this, even if your eclipse claim that it is the latest version, you should go on the homepage and manually reinstall the latest eclipse with ADK or just install the android studio
I am having trouble setting up the build path of my java project. I am currently in a Co-Op IT position so I am somewhat new to all this. My background is mostly in C++ and I am learning java on the fly. I am also somewhat new to Eclipse (Kepler service release 1).
I am working on a bug on an existing program and need to get the program to build so I can work on it. When I add all of the external .jar files that I know for a fact are the right ones, I am getting this error on two of them :
"Archive for required library: '(location of file)' cannot be read or is not a valid ZIP file"
Two of the other full time guys on my team have gotten the program to run with those exact same .jar files, one running Eclipse Indigo and the other running the same Kepler version as myself. I also was able to open the two .jar files manually and everything appears to be there. After every trial trying to fix this, I have refreshed, cleaned and restarted eclipse. The two other full time guys said they have never seen this error. I would like to get some insight on this from anyone who has any similar experiences so that I don't have to use up much more of their time.
I Had this issue, just fixed by deleting .jar files from Libs directory then copy->paste original Jars again. Then do a complete clean -> rebuild
I got this problem, took help from following link solution
which basically says to
1. delete the corresponding maven download folder
2. maven>update project in eclipse
In my case I deleted hibernate folder, since i was getting error related to hibernate-validator.jar
I had the same error here. What I did to resolve the problem was close and reopen the project.
I got the same problem and found out the root cause is the JDK in my linux shell is set to 1.6, but in the eclipse, the JRE is 1.7.
Using Eclipse without m2e features (Standard Edition) helped me.
Similar problem with Spring toolsuite
Just came across this link that shows a way to get unblocked.
In preferences dialog box go to
Java->Compiler->Building
and change Incomplete build path to "Warning" (from default "Error")
This can be done globally (for all projects), or on a project by project basis.
Check the jar's file permissions/ownership.
I had the same issue on eclipse installed on Linux and fixed it by setting the file permissions right.
In my case ..worked after removing this from spirngrest-servlet.xml file.
<prop key="net.sf.ehcache.configurationResourceName">/Sysehcache.xml</prop>
I think it had to do with default location of maven repository of jar files.
Been at it for 3 days. finally solved it.Hope it helps anyone.Just look for similar think in your spirngrest-servlet.xml file. Good luck.
I just tried the following and it worked:
Close eclipse as there might be some files eclipse is accessing and you won't be able to delete.
Delete all the libraries installed in the maven repositories folder: ".m2/repository"
Open eclipse and update your project(Alt+F5).
What did we just do? : This is possible that the existing libraries in the local repository are erroneous and maven tries to open which it fails in. We have now deleted the already existing library and with the project update, Maven will download the library again which should resolve the issue.
i fixed this by just deleting everything inside of the /Users/username/.m2/repository folder. not the repository folder itself. and then running a mvn clean package in the project folder
I'm on Eclipse for hours now and I didn't found a solution yet for my problem even after many searches on internet: I have no more R.java file on my projects.
On just created or on my old projects, i don't have R file anymore and I tried so many solutions (uninstall, re-install Eclipse, clean my project, check all my XMLs, fix problem with android tool and so on ...)
Please someone can tell me what to do in this case?
Hey If you just updated to ADT Rev 22 :
I had the problem too. There is a new component in the Tools folder called "Android SDK Build-tools" that needs to be installed.
Step 1
Open the Android SDK Manager
Step 2
Select the newly added Build Tools and install. (If problem stays then go to Project Properties => Java Build Path => Order and Export and check Android Private Libraries, then clean and build project.
It may be necessary to repeat the process, restart the SDK Manager after the update and make sure it looks like this (all tools installed):
More info:https://groups.google.com/forum/?fromgroups=#!topic/android-developers/rCaeT3qckoE%5B1-25-false%5D
Perhaps in Project Properties -> Java Build Path -> Libraries you don't have:
Android 4.2.2 (or other version)
Android Dependencies ?
If so, then right click project - > Android tools -> fix android properties
and see if this library showed up.
Thank you all for saving me! I've spent the whole afternoon on search this error.
Finally, my project works.
By the way, I also encountered one problem which i wanna share with you:
After upgrading, even if my project has not errors anymore. During runtime, it seems it couldn't find the classes from the jars placed in \libs.
Go into Project=>properties => Java build path= > Order and Export.
Please make sure all your jars are checked.
If this problem occurs suddenly in a well working project,
the first step is to find whether the problem occurs only in the current project or in all other projects.
if all other projects in the current workspace are working then 90% problem is with XML / mainfestfile/resourse file that you edited recently.
This error is not shown as red mark we have to find out what we have done recently in these files.
try this
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
it solved my problem
Close your eclipse and after refreshing system, try to open Eclipse again. I think you are using Emulator along with the eclipse. It may be because of the low Memory problem (RAM) of your system. I used to face the same problem when I use Emulator
whenever there is any mistakes in any of the xmls the R goes missing when a build or clean happens so check for any xml errors in your project unless you fix it you cant get back your R on clean or build. fix the xml files and perform a clean you will have the R generated. Also check in File->properties->Builders and see if everything is checked
I was using Eclipse Indigo and nothing I tried worked. I ended up downloading Juno SR2, reinstalling the ADT, and now everything works again.
Reinstall everything and it'll work.. i.e. go back to Google SDK or w.e. you're using and download it.
Update it to latest in SDK Manager.
Go into Eclipse-Project-Prefs-Java build path-order/export TICK EVERYTHING.
problem: No R file get generated.
guess: Try cleaning project if it is old one. Else create new project with no R get generated and with no compile errors but this: no project.apk
In this case you have to check your SDK for the built-tools. May not be installed after updating SDK.
Thus download them if not download here, then put them under directory: SDK/built-tools folder. Lastly, and most important, is to Run the SDK As Administrator. This guarantees refreshing SDK with all packages appearing in it.
Install the SDK-Built-Tools or any missing packages according to the above link and you're done.
hope this helps.
Try one thing, create a new Android Project and transfer all those files which are in the previous project. That worked for me.
In my case there is error due to "&" inside strings.xml file(but error not shown) for declaring string for a array type. Now the problem has been solved as I changed "&" to "and".
So, please make sure that you do not have such silly use of symbols, and clean the project.
I have had the same kind of problem, however Rechecking all XML files in the Resources folder was helpful in my case. I found syntax error in my XML files. Cleaning and building the project again can be helpful sometimes too.
I had the dreaded not more R.java.
Some of the things I've used in the past:
Clean / rebuild (the first thing we all try)
Restart eclipse (optionally reboot pc/mac)
Update both SDK/ADT eclipse plugin to latest version
Create new eclipse workspace and import project
Enable Verbose AAPT build output Eclipse menu>Preferences>Android>Build
Port project to Android Studio / Gradle (this helped my actually see the AAPT error i was getting Error Code:138)
Delete recent XML changes - Ultimately I found deleting recent menu.xml files I'd added and commenting out where they were referenced fixed the issue and I finally got R.java.
I got the error recently and had found no fault in any layout or value file. After a lot of tries I add another Activity and the R.java was build and the error disappeared. I don't know why this occur, but it takes me hours.
Eclipse is giving me a few problems.
After a cold start and the loading of android libs, Eclipse underline the import statements or says that java.lang.Object couldn't be found.
Closing it and reopening often fix the problem. If it doesn't, another close-open fix it definitely. But it shows at each cold-start.
It also gives
"The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files"
"The project cannot be build until build path errors are resolved"
But if i restart the build path errors and the enum problem are not show any more(sometimes the enum proble got fixed some time after eclipse's loading finished)
"Project 'xxx' is missing required source folder: 'gen' "
that should be generated automatically generated while building, and still restarting will fix them
In addition, in many projects, while building or cleaning, eclipse says that it couldn't delete the bin/. directory. I noticed that that directory is read-only, and if i try to remove the attribute(even from dos), it immediately return to read-only.
This problems aren't show-stoppers, i still can code and i still can get my apps exported, but it is quite annoying to have to restart eclipse a few times before being able to use it(and eclipse isn't that fast at opening), and i would really know how to fix it.
I searched in the net a bit, but i dind't found nothing useful or that worked.
Is there a way to fix them?
I didn't "unistalled"(it is just stored in a directory) Eclipse, since i should then reinstall android sdk, mercurial plugin, and re download and set up a few libraries i use in quite all my project, and i really hope there is another way.
final notes:
everything works when this problems doesn't show: the app works, logcat too, the right device is used to install the app, so i think java and android sdks are installed just right
I had that problem before so I just saved my projects to a different file and uninstalled everything ( java, android sdk, eclipse ). When I reinstalled it all I put the android sdk on the root of my c drive as I have a windows machine and then instead of picking where java was installed I let it do its own thing. I dont use a mercurial plug in but your "read only" problem could be related to that. Its possible your downloading files that are "read only" and there for you have no way to alter them. Im guessing since you said youve been programing you already know how to set the build paths and stuff. It might just be where everything is installed or something silly like privilege settings on your machine.
What were you using the mercurial plug in for anyway? just curious :)
Have you included the java lib in your project or? For a couple of weeks ago I sat with an project where i absolutly needed some of the methods, so because android just have some of the java lib I imported the need libs and used that.