views:

2864

answers:

7

I'm storing my Android project in a Subversion repository. After recently shuffling a bunch of stuff around I started getting tons of errors like:

syntax error    entries /project_name/src/.svn line 1 Android AIDL Problem
syntax error don't know what to do with ""  entries /project_name/src/.svn line 28 Android AIDL Problem

etc.

It seems as if Eclipse is trying to build the files in the .svn directories now. This setup used to work fine, how can I fix this?

A: 

You have your src folder in your build path, as such, it will try to build anything in your .svn directory. My suggestion would be to remove the .svn folder from the src folder.

Alternatively, you can choose to exclude folders from your build path. If you have Eclipse 3.4+, go to your build path and under source, you should see something called Excluded under your src folder as listed in the Source Folders on Build Path.

Go to edit and you can include a pattern to stop the .svn folder from being included in the build path.

Edit: If you want your folders to be hidden in the package explorer, hit the down array found near the top of that view (it's a white arrow) and hit filter. Then check the box that says Name filter Patterns and type in .svn, that should hide that folder.

AlbertoPL
Building up the exclusions for all the .svn directories in the build path didn't work. However, I did figure out how to tell it to not show all the folders... thanks.
fiXedd
I'm assuming you tried wildcard parameters when excluding the directories from the build path? I'm surprised excluding all of the .svn directories didn't work... did you make sure there are none of those folders present in the Libraries tab?
AlbertoPL
Yeah... I tried several variations and none of them worked (eg: .svn .svn/ .svn/*). Also, checked the Libraries tab and they aren't included there.
fiXedd
I've just tried the same and it didn't work for me either.
Artem Russakovskii
+5  A: 

Install the Subclipse plugin for Eclipse. Then Eclipse will know what the .svn folders are for and quit treating them as source directories:

http://subclipse.tigris.org/

Rafe
Installing subclipse didn't work. Even if it had that still doesn't really tell us why it used to work then decided to stop.
fiXedd
A: 

if you have the patience or not have too many of them folders you can right click it in the navigator view and make sure to check the derived property.

This should cause eclipse to ignore these folders.

...hmmm... wait a minute... you said you shuffled a lot of stuff around.... did you do this through windows explorer or inside eclipse ?

There are commands in SVN to move folders that are under source control, if you do not use them you run the chance that SVN will not recognized these folders from their original and will loos history attached to the file itself. worst somethins I got some weird side effects where the only solution was to

  1. delete all the .svn folders
  2. copy all the source elsewhere
  3. do a checkout from scratch
  4. overwrite the files from repository with backup in 2
  5. checkin

Then I did the rearrangement from eclipse or directly in the SVN through the SVN repository explorer and started working again with a new checkout.

Usually eclipse deals fairly well with these .svn folders but in some rare occasion it gets all out of whack and I had to start from scratch, sometimes reinstalling eclipse from pulse directly (try pulse it's definitively worth it, reinstalling your environment from scratch on a new system is but a few clicks).

Anyhow.. hope this helps... good luck

Newtopian
I can't seem to figure out how to change them to "derived" as the .svn directories don't show up in the package explorer. I moved the files with the SVN tools... not Eclipse or "Windows Explorer" (actually running Linux here). Tried the 5 steps and I have the same results. I'll try reinstalling, but that's kindof a last-resort step for me right now.
fiXedd
Ok, I did a variation on the 5 steps and got it working again. 1) created a new project 2) copied in my files AND the .svn directories, but none of the Eclipse stuff, from the command line 3) had Eclipse refresh the directories and voila... it's working. Thing is, I did a diff on all the new and old Eclipse-generated files and they're identical. I REALLY don't understand this.
fiXedd
Wow... this is quite puzzling indeed... happy you got everything back working correctly though. Eclipse can be a pain in the ass sometimes when it starts acting up, though I usually find a way to coerce it back to normal but there are times when I just want to smack the thing.
Newtopian
No joke... this is the "severalth" time I've run into something like this with Eclipse. I'd have thought that they'd have ironed out some of these bugs by now.
fiXedd
A: 

I would recommend using the Subversive plugin to provide proper integration for using svn repositories with Eclipse.

Mark
yeah subclipse does not seem to be updated very much anymore
Nathan Feger
Since Subversive is now the an Eclipse project it is pretty much the official SVN provider.
Mark
Subclipse is perfectly up to date and supports SVN 1.6. It's *not* true that it's not updated anymore.That said, Mark is correct anyway: Subversive made it, Subclipse didn't...
Henning
Installing subversive didn't work. Even if it had that still doesn't really tell us why it used to work then decided to stop.
fiXedd
The Subversive provider is unreliable on existing projects - sometimes you can get it to play nicely with previously checked out code, sometimes not. Best results obtained (not 100%, but most likely to succeed) were when I would blast the Eclipse project, then use the Import... function (hoping the Eclipse/Subversion would automatically figure out the hookup). Have generally had the worst luck with the "Team->Share Project" path.
M1EK
+6  A: 

Although you can solve this problem by installing a plugin such as Subversive, which has already been mentioned, you can also solve this problem without the plugin.

You can tell eclipse to ignore files stored in the .svn directories inside your build path. To do that, open up the project properties by right-clicking on the project and then select the Java Build Path option on the left. Look for the Source tab. There you'll see all your source folders (if you haven't changed anything this would be gen and src for Android SDK 1.5r3). Double click the Excluded item in the tree and add two exclusion patterns for each directory:

.svn/**
**/.svn/**

You should set the svn:ignore keyword of your project directory to ignore the directories, which contain automatically generated files, as they can be generated at any time and do only take up space in your repository. For a current Android SDK 1.5r3 project this would be the bin and the gen directory. If you ignore the gen folder this also means, that you don't need to set the exclusion pattern for this directory, as Subversion doesn't create a .svn directory inside ignored items.

Edit: As mentioned by Henrik, it is wise to clean the project after such a change.

Xperimental
This works juste fine :)
Sébastien Nussbaumer
Worked like a charm, had to clean my project though.
Henrik
+3  A: 

It is worked for me:

  • Delete your project from eclipse (not from disk).
  • "File"->"New.."->"Project"->"Android Project"
  • in "New Adroid Project"-Dialog selected "create project from existing source" (find your project on HDD)->"Finish"

my .classpath-file

<?xml version="1.0" encoding="UTF-8"?><classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/></classpath>
russenreaktor
That's exactly what I ended up doing. Feels like there should be a better way though.
fiXedd
worked for me too. +1
herbrandson