Eclipse can see resources which do not exist - android

I am new to Android development.
I created an Android project, and imported some images as resources.
Unfortunately, one of them contained a capital letter, which is illegal. I have first renamed, then removed the offending image. Then I delete all images, but Eclipse still insists they are there after clicking refresh refreshing and running clean several times.
Could anyone tell me how to fix this?

If the file actually exists in your workspace . Just Right Click the file and select Validate . It should be alright

Related

Generate Annotation files Automatically in Eclipse

I am using Annotations and svn(Version control) in my application. I have created one package inside of my application and some Activities inside of it. Now the application is perfectly running. I just committed the files to svn and tried to checkout files from another one pc. Now my projects contain some errors. The errors happen whenever I use intent for calling new Activity that shows an error. The error says "Summary_ cannot be resolved to a type"(Here I mention summary is my Activity name).
And I just add a space in that java file and save the error is gone. But I can not ask other peoples to do this every time. Because this also happen whenever the eclipse is restarted or when I clean my project . Checkout from svn. Update svn.
I guess the annotation files are not generated. Please anyone help me to solve this issue.
Note : I just added a space(or whatever) in that java file and saved. the error is gone . I want to know why it is happening?

Problem facing while accessing already created project into the workspace

This is the problem am facing since many days. am trying to manage that but not able to solve that. while am try to access the project which is existing project into workspace then am getting some kind of error at the "#override" tag and when remove that the error disappear and single error will be shown at the application name and that cannot be removed. Am doing for the mean while is try to copy all the code from the each java file and paste it to another project that was created newly.
Can any one help me in this concern. Thanks in advance.
Your problem is related to JDK for this what you have to do is from menu options choose
Window > Preference then navigate to node displayed in below image and set "Compiler compliance level as 1.6"

Attempting Android Notepad Tutorial - Exercise 1 - More problems

This maybe a continuation from 2 of my previous question, or maybe it's a completely unconnected problem.
Previous questions were
Questions on Notepad Tutorial:
Can't read ... AndroidManifest.xml - while attempting Android Notepad Tutorial - Exercise 1
The tutorial asked you to select "Create project from existing source". My 1st original question was where to copy the template (original source) to and from the answers I received, It looks like I should copy the directory-structure/source under the C:/Development/Eclipse/ directory, so it would look like this
_ C:/Development/Eclipse/Notepadv1/... _
I did that, and then tried to continue the tutorial, but when I got to the part that says to select "Create project from existing source", I received a pair of errors
C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-
(Same error prints twice in the Console & WorkSpaceLog
So I posted a second question about the FileNotFoundException:, and received an answer saying to ignore the message, happens all the time... so I deiced to plow forward again. Now I have 2 problem. One of the problems may well be of my own doing, trying to run threw this tutorial dozens of times, and attempting to back out my changes over and over again.
Problem # 1:
I once again start to create the Notepadv1 project using "Create Project from Existing Source" (The cant-read-androidmanifest-xml error still appears), but as suggested I just ignore it. I next select "Android 1.5/Platform 1.5 as the Build Target, BUT the field where you enter the Min SDK Version is grayed out, and you can't enter the number 3 there.. The tutorial says to put the number there, but it seems to become grayed out at the same time I select "Create Project from Existing Source" and get the "cant-read-androidmanifest-xml" error.
Problem # 2:
If I click on [Next] twice, or [Finish] once, I get a pop up box with the message "Invalid project description" - - "Reason: Invalid project description"
[Details>>] "Invalid project description.
C:\Development\Eclipse\Notepadv1 overlaps the location of another project: 'Notepadv1'
".
This did not originally happen. There is no mention of the "Notepadv1" in the Package Explorer or Navigator windows, so I can't find any way to remove it, and I have run Clean Projects, exited eclipse and rebooted the machine a few time... in a few different ways.
Any suggestions? Joe
P.S. I have not yet accept any of the answers to my last question, because the juries still out. I'm not yet sure they were correct. I'll will make sure I go back and accept an answers, once I figure out what the correct answer is - Joe
I had the same issue, and just got it working!
I have no idea how to fix, I'm still getting the error, but It's not hindering me from continuing, so I'm not worried about it.
Is very simple, you shouldn't have copied the Notepadv1 directory into your C:/Development/Eclipse directory, because, when you "Create project from existing source" it copies it there for you. So, the one it's trying to copy from is getting in the way of where it's trying to copy to.
Hopefully that makes sense, and helps.
Problem 1 is because the androidmanifest.xml is missing.
Problem 2 Notepadv1 already exists in your workspace.
If I were you I would change your workspace to your Documents/My Documents or equivilant folder depending on your OS. You can do that under File->Switch Workspace->Other. Then delete what you have under the Eclipse directory. It could get messy if you update Eclipse or have multiple versions of Eclipse.
Where is this Notepad project? Is is part of the SDK? If it is I would use File->Import to copy over to your workspace rather than mess with the SDK copy. That is probably why the manifest is missing.
If you would like more help let me know.
PS. You will probably want to reinstall the SDK if the Notepad manifest is missing.
EDIT:
#Joe. I couldn't say why other tutorials worked and others didn't for definite but using the SDK as a workspace is definitely going to end up being programmatic when you are learning. My SDK is separate from my workspace. So, in a brief summary, I would keep the SDK, the Eclipse source and your project workspace in entirely different locations. And we can start from there if you want more help.
Very Simple, you need to clear the workspace... to do this adopt following 2 steps
Right click on your project and select Android Tools and now select Fix project properties
Select Project from menu and now click on clean.
This will work for sure
Re: problem #2...
My apologies if it's inappropriate to cross-post an answer in multiple threads, but it was asked in a couple of places so in the interest of helping novices with the Android environment (of which I'm one) I'm posting it here as well.
I'm using Vista, Eclipse 3.7.0
I don't know what "File | New | Project | Android Project | Create project from existing source" is supposed to do but I couldn't get it to work for a set of unzipped files of a project tutorial I got from elsewhere. I kept getting that error.
I found what did work is:
1) Copy the unzipped file tree for the project to wherever you want it to eventually reside.
2) File | Import | General | Existing Projects into Workspace | Select root directory:
and point it to wherever you put the zipped files, check-box on for the Project that is the one you want, then Finish
Step 2 seems to not actually move the files anywhere (even though the term 'import' implied that to me), but it seems to just make Eclipse aware of where the project is located and it uses the project from that directory.
That seems to work at least for me.

Cannot find the culprit file in my android project even after expanding the main folder

The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that?
Error log shows: Current file is not a match for the given config.
Sorry I just came across this now, but I've had the same error too, so I'm sure others have. There was a quite a bit easier solution than what you had to do, at least in my case. I had the exact same problem, where my main project said there was an error, so I couldn't debug or run, but there was no apparent error, other than the red X on my main folder.
In order to solve this, I simply closed the project by right-clicking on the main folder, and selected "Close Project". Then, I right-clicked on the closed project, and selected "Delete". Don't worry, this will not delete any files, it will only remove it from the workspace, and will make sure you really want to do that by asking you to confirm. Now, just click on File->Import and select "Existing Projects into Workspace". Choose your parent folder for your app that was erroring, and import it. The few times I've had the phantom error on my main app, this has fixed it each time.
Whether there is an underlying cause and this process simply refreshes something in the workspace, I'm not sure, but at this point this fix is fast enough for me to use it.
Hope this helps next time!
Project -> Clean
Closing project and opening it again fixed it for me.
formed a new workspace and formed a new project. Added each file individually. Now it shows no error.. but still can't figure out what was wrong with thr previous code..? :=(
I faced the same issue..
there was a problem in manifest xml..
the path was not set properly. there may be space in the path..
I just copied the activity tag from other project and pasted in my project and just edited the path in android:name. it worked fine..

Refresh list of drawables in Eclipse?

When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser. I checked the R file and there are references for the files.
I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help. Sometimes a couple will randomly show up in there, but not all of them.
The only consistent way I can get them to show up is to restart Eclipse.
Any ideas?
Thanks
Edit: Further findings:
After some trials, I found an other inconvenient work around to he issue. Turns out when importing multiple files into the project at once, Eclipse will only add the last one imported into the reference chooser. So when I imported my images one at a time, they all show up properly!
Like I said, inconvenient considering the amount of images I have left to import, but maybe with this new information it may help nail down where the issue may be and a possible fix.
I too faced the same problem. I added an image to the res/drawable-hdpi folder, cleaned the project and was able to see the name of the image in the left pane in Eclipse. But when I tried to use this image using Reference Chooser and looked under Drawable, I didn't find it.
I simply exited from Eclipse, and started it again. It was there! Like many things in computers, problems can be resolved simply by restarting!
The only way I found to fix this is to include the generated R class itself.
I found out some new info again.
Since I am doing a port from Blackberry, almost all of my images' filenames have uppercase letters in them, so I end up importing them all and then having to rename all the images after they are imported into the project.
I tried renaming all of my images before importing them all into the project. To my delight, all of the images showed up right away in the reference chooser! So it seems there is a problem when you import files and they cause errors with your project and allowing all of them to show up in the reference chooser.
So if you have to rename files, do it before import!
I'm just not entirely sure that this is the only cause for this issue but it has solved the problem for me.

Categories

Resources