Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
01/07/13 06:41 PM (13 years ago)

Adding projects to eclipse - problem?

Had to re-install eclipse, so I've got the latest version. Needed to add my projects back into the workspace. It looks to me like only one project can be added to eclipse, because both options - import or file > new... - pick up the 'package name' as BT_activity_root, which I assume is the BT_activity_root.java file in every project? Anybody got any ideas, because I assume that renaming the BT_activity_root.java file is just going to cause major issues throughout the project.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 06:47 PM (13 years ago)
The import utility reports: Cannot import BT_activity_root because the project name is in use File > New > Project > Android > Android project from existing code reports: Cannot import BT_activity_root because the project name is in use There are no options to change the name.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/07/13 06:48 PM (13 years ago)
I can't remember where I picked up this nugget... But the first thing I usually do is rename my project to something I prefer. Once it's in your package explorer, select the project folder, right click, and choose 'Refactor > Rename' and it will allow you to rename your entire project, and will cover all the internal reference changes and stuff as well. It's pretty slick. Hope this is what you're looking for. Cheers! -- Smug
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 06:50 PM (13 years ago)
Thanks @Smug, it's what I would have suggested! But my project is renamed, my package name is renamed, it makes no difference. I can't get the project in eclipse to refactor it because eclipse will only pick up BT_activity_root as the package - which it isn't.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/07/13 06:53 PM (13 years ago)
Oh, if you're having workspace issues because you just reinstalled Eclipse, you may need to relocate/remove your workspace and let it build a new one for you. You can figure out where they are if you go to your Eclipse Prefs, and snoop around "General > Appearance > Startup/Shutdown > Workspaces". Cheers! -- Smug
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 06:55 PM (13 years ago)
I use multiple workspaces, I've tried that. I've also tried adding a project as an archive and as a general project. I did a search on BT, someone posted about it a few weeks ago, but it sort of faded away without a working solution.
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/07/13 06:58 PM (13 years ago)
Yes it changed. New > Project android existing project What I usually do is go to refactor and rename.. Then you're all set.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:00 PM (13 years ago)
Hi @mysps, Yes, but I can't get the project into eclipse to do a refactor rename! This is the thread from a few weeks ago: https://www.buzztouch.com/forum/thread.php?tid=964EFACC4863DD72A74771A&currentPage=29 identical problem, but no solution. BT_activity_root is NOT the package name, but eclipse thinks it is. The only reference to BT_activity_root is the BT_activity_root.java file in the src folder.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 07:08 PM (13 years ago)
@mysps - are you using the new android eclipse? (The splashscreen on start up is android, not eclipse). In my previous eclipse version, I had to use New > Project > Android > project from existing source, but with this latest eclipse.. well, I posted above. Nothing I try allows me to add more than one bt project into eclipse.
 
Mosco
Apple Fan
Profile
Posts: 12
Reg: Dec 27, 2011
Virginia
120
like
01/07/13 08:17 PM (13 years ago)
..
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 08:26 PM (13 years ago)
Ahhhhhhhhhhhhhhhhhhhhhhhhh, two dots have appeared...... :)
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/07/13 08:27 PM (13 years ago)
@raveyd sorry i stepped away from my computer. i don't have an android splash screen - purple eclipse. im using mac and this is what i do: https://dl.dropbox.com/u/3222229/android-existing.png Eclipse SDK Version: 3.7.2 ADT Version: 21.0.0.v201210310015-519525
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/07/13 08:29 PM (13 years ago)
lol @raveyd... my little brother was with my computer making an app and editing and forgot to logout. does yours look the same as mine? when I upgraded eclipse this summer that option to add new android project from source did disappear and i had to do the refactor which was not need before. maybe you have to install the new eclipse in a new location? hmm
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/07/13 08:33 PM (13 years ago)
Yeah, that's one way I can't do it any more! My eclipse is more recent, 3.8.0, maybe I can reverse the install to your version? as that was fine before my pc blue screened (Yep, WinXP is still alive and kicking!). Maybe I'm missing something obvious, my head's mashed! I'll revisit it in the morning.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/07/13 08:56 PM (13 years ago)
Hey @raveyd, You cannot load a BT project? File-New-Project...click on Android then Android Project from existing code. LA
 
Higgey
buzztouch Evangelist
Profile
Posts: 394
Reg: Sep 07, 2011
West Midlands
13,540
like
01/08/13 02:48 AM (13 years ago)
Hi @raveyd, I sympathise. The same thing happened to me and it drove me nuts. I use Eclipse SDK Version: 3.7.1 and I open the project I'm working on, right click on it, and go to Refractor, Rename. I can then change the name easily and I can close the project and add more as I wish. This appears to do something completely different to using Android Tools, Rename Application Package. I hope this helps. Otherwise, have you considered downgrading eclipse? Have you still got the old version as zip file somewhere? Oh, and I changed my workspace location, too. Hope you get sorted soon. John PS Happy New Year Everyone!
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/08/13 06:54 AM (13 years ago)
Why do you want to rename it, when you can rename it in the workplace? Sorry just trying to learn and a little confused. LA
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
01/08/13 07:51 AM (13 years ago)
Got it! whoohoooo! A BT_activity_root project remained in the metadata of the workspace, even after deleting the project and selecting 'delete project contents on disk'. So the project was removed from eclipse and the workspace but remained in the workspace metadata for some unknown reason. In case anyone else has the problem, the location of the undeleted folder was: Path to workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\BT_activity_root. Manually deleted that folder and now it's ok. Thought I was going mad.
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
01/09/13 05:55 AM (13 years ago)
This happened to me today, but it got sorted when I copied the the project files to the workspace.
 
sxywebgirl
Aspiring developer
Profile
Posts: 158
Reg: Apr 12, 2013
Altadena, CA
7,530
like
05/03/13 12:51 PM (12 years ago)
@raveyd, Your info about deleting the old metadata worked for me to solve my same issue. I had to turn on "see hidden files" on my mac before I realized there were actually files to reference in the workspace! The folder looked empty. Thanks, sxywebgirl
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/03/13 02:00 PM (12 years ago)
Hi @sxywebgirl, glad it helped someone else, I remember I was close to throwing my pc out of the window! Sometimes eclipse is so frustrating.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.