I saw the question in this post and I have a similar but perhaps more detailed question. I have just installed SVN and Subversive and I added an existing project to a repository. Then I checked out the project and opened it. Unfortunately, in Eclipse, the Subversive layout has taken over the Android layout in the Project Explorer view and I'm not too happy about that.
In other words, the Android layout organizes the project under src, gen, assests, res, and other nodes, whereas the Subversive layout organizes the project strictly by the folder structure under the repository. Is there any way to use a source control plug-in AND keep the Android layout? If not, I may just resort to removing the Eclipse version control plug-in and manually use TortoiseSVN.
I remember having a similar issue with my team.
we thought that having the eclipse plug in would be a great idea (handling everything from the same app) but we got lots of problems with the layout and the conflict resolution.
my advice is to keep editing in eclipse(neat beans or whatever IDE) and use tortoise in your explorer to commit, and when you update hit F5 and continue coding ^^
Related
I am trying to transition all our projects from Eclipse to Android Studio (Finally decided i had to do it..!) but i am fighting seriously with the way how Android Studio / gradle works - in regard to using external library projects.
Until now in Eclipse - we used to have all the dependent projects in the same workspace and they where 'shared' amongst all projects which were under development.
That made it extremely nice to do changes on the external changes and commit them separately to their own SVN repos - while the projects using them - to take advantage of the changes without thinking.
That goes specifically to one library - our own framework which we use for all android projects and it is constantly being developed, altered, partially reworked and used by several people.
But then came Android Studio... the problem is that say if i have an example project with 10 sublibrary dependencies, including our framework - Android Studio with physically COPY all files into a subfolder of the main root project - loosing all the capabilities to 'commit' changes later being done to the sub libraries - to their own SVN repos.
I've tried pretty much everything, i think i've read everything :) but crap - nothing seems to 'fix' my work case..
I tried to checkout one sublibrary in the already checked out root folder of the root project and tried to import it into it - but ofcourse Android Studio says 'library already exists' - so that doesn't work. Even if it did... the library itself has its own deps and what i saw is that Android Studio will decouple them upon import and put them at the same level in the root project.. which completely messes everything up.
So my question is - even if i understand this is no longer possible - is there any EASY way i can at least COMMIT BACK to the SVN repo of the sublibrary from within the root owning project - using Android Studio (by easy i mean from the UI directly without needing to mess with manual console merge hazzle...)
I can't understand how anyone has not solved this yet - i am sure everyone is doing this one way or another?
Could someone share a good practice way of 'doing' it? :)
THANK YOU!
What i did:
Switched to: git
Converted our subprojects to git from svn
Made all subprojects externals of the primary project
Included the subprojects in gradle with the help of this post: Android Studio 0.8.1 Creating Modules without copying files?
Cons:
Not fully manageable from Android Studio - have to do half commits in Studio, the other half + pushes in console - so i ditched Studio completely and moved all to console once again. May be this ain't so bad after all :)
What i did was use Blundell's advice - although i really... really ... REALLY didn't want to go switching completely to git...
We have over 300 repos here in SVN and it's really not the time to start the git hazzle...
But this was the only workable solution so far as git externals make it really really easy to work in such way.
The f**** up thing about this is that half work has to go to console again... Externals and adding git remotes can't be managed from Android Studio... Life, i guess :)
HI I have and android project A, I have been working on it, and also a friend of mine has been working on it, so now I have 2 projects A-Mine and A-Friend (I have nor svn, cvs nor git). Is there a way to get a diff of or to merge them, using ecplise or tortoise or anything (windows based)
Thnak u very much best regards Ignacio.
Now's a great chance to set up source control! Commit your version into source control, have your friend check it out, create a new branch and recursively copy all his files into it. Then just use the tools provided by your source control software of choice to merge those changes into the main branch. Done!
As I thought my friends there is always another way, Turns out ecplise won't allow you to open twice same project in the same workspace, but you can very well match up files and folders with simple windows copy + paste, so what is what you do? Yo open one project in eclipse and paste the renamed folders of the second project. the you can use Eclipses Compare With tool, to match up all files in a certain directory.
Clean, easy and fast
I use two computer for coding. My desktop pc and the notebook. I sync the two computers with dropbox. How can I import/load a project on each of this two computers? The project base folder is different on each computer. When I try to load/import a project which is created on the other computer it loads the project but I got a error with a wrong path.
"Gradle "Test2Project" project refresh failed:
Could not fetch model of type "IdeaProject" using Gradle distribution "http://services.gradle.org/distributions/gradle-1.6.zip".
Project directory "C:\Users\thomas\AndroidStudioProjects\Test2Project" does not exist."
The wrong pfad is the right pfad on the other computer. How can I import Android Studio projects so that it works even on another computer with a different folder structure?
Like the others i agree, that using a VCS would be the best solution. Even though you can try to filter all android studio related files (like *.iml, .idea folder and local.properties). I don't know if you can do this with dropbox or if you need some kind of 3rd software.
After that you should be able to make source code changes on both computers without greater problems. (You may have to declare project dependencies changes for the android studio twice)
Builds depending on the build.gradle files should work to. But again: using a VCS is the better way to go.
Go for git, you can use bitbucket.com as a free remote repository.
This is a problem I have ran into when trying to store Android projects in a Dropbox folder. What happens is that Machine 1's IDE is mapping system resources (like the SDK) as being in that machine's filesystem. When you go to Machine 2, everything will work EXCEPT for what you expect--because the SDK will probably be in a different spot!
One way to get around this is to use your VCS (dropbox, git, whatever) as a repository for JUST your source files, and then have a local project created on each machine that reads from the Dropbox folder. This requires two separate projects that are mapped differently, but that have the same source folder.
I discovered this problem when I tried to load up an Android project on a new install on a Mac machine:
Do you see what's happening there? My Mac Android Studio is saying, "Hey, I don't see where "C:\Android\SDK is, but I do see that you have an Android SDK in a different folder, so I'm going to update your project files to reflect the actual location of the SDK."
In my opinion, the only way around this is to create your project on both machines, and version control your source and assets folder. If you don't create the project separately on each machine and use VCS for just the source and assets, the only way to get around build and filepath errors is to store your SDK in the same folder on each machine. This worked for me when I was building on a Windows desktop and Windows laptop, but no longer works for me since I am using a Macbook Pro.
I know this was questioned about 4 years ago, but this is up to now still an issue. Using a VCS seems like a good solution, but for me it is simply more overhead than i want to have. I also use Dropbox to synchronize my folders and the history they provide is for my private programming needs good enough. So i think, it would be good, if android studio simply uses relative paths.
I know it needs some system paths and it does a good job in looking at the local.properties and setting it to the correct place when the project is loaded.
The main problem with using Dropbox are the build-directories. There are many many references to fully qualified paths in the files within these directories. So my solution was to exclude the build-directories from Dropbox-synchronisation.
When you work at your laptop, build the app, create new files, change files or delete files, the build on your pc will be completely outdated when you switch back to it. but android studio will recognize this and do a fresh build when you start your project for the first time after working on the laptop.
so the biggest problem at this point is the file local.properties and this is handled correctly by android studio. it may be a good idea (or a really bad one, i don't know the drawbacks) when the build system wouldn't write fully qualified paths in the files within the build directory.
But up to now this is my solution for using Dropbox and not using a VCS:
exclude build-paths from Dropbox synchronisation
i hope this helps somebody.
I've come to use Eclipse to develop for Android on my Windows machine for quite some time now, but more and more I've been booting up into my Ubuntu partition. I honestly love both operating systems as they both have their pros and cons, but I boot into each one randomly. Anyway, I have three partitions on my hard drive. One for Windows 8, one for Ubuntu, and one for shared data (docs, pics, videos). But I would like to seamlessly develop on one OS and then on the other. So, my data partition should be able to hold my workspace, but I don't know if that will ruin or corrupt the .metadata and potentially ruin my projects. Basically my question is... are there any tips or tricks with the Android SDK, AVD, ADT, workspace, or .metadata when using them between two OS's so that it works seamlessly?
In theory, you can use two different installations of Eclipse to manage one shared workspace. However, you could potentially run into problems if you aren't running exactly the same version on both sides (or, if you upgrade one side but not the other).
In practice, you are probably better off having separate workspaces on each OS, and then having a shared repository (using Git, for example) to share your code. Not only will that work better, but you'll be using source control too.
People have tried that before and run into trouble, so please go with the version control solution instead.
The drawback is that only the project contents are shared in the version control system. You will have two completely separate workspaces. So if you change workspace settings, they need to be changed twice (and don't even think about having .metadata under version control, that will have bad side effects).
Please be aware that several settings in Eclipse are available as workspace settings and also as project settings (e.g. the Java compiler version to be used). Make sure that you use the project settings and that you put the contents of the ".settings" sub directory in your projects under version control, because it contains these project settings. So they are in sync between your 2 machines.
I have been sharing workspace between linux and windows for quite some time and I only had minor hiccups.
Here are some of the things to keep in mind, if at all something has gone wrong, and you want to try some quick fix.
Initially you'll have to point the location of your sdk to the windows or linux path. This would be the first error that can crop up.
Try a clean build of the project(Project -> Clean -> Clean All Project -> Click OK)
Check Location Path of the project (Right Click Project -> Click on Resource). If it is loading from an ubuntu path (Eg: /home//Android_Projects), then you'll have to delete the project (Not from disk but from workspace) and import again.
Hope this helps.
Hey guys simple question here. Whats the best way to back up an android project? I use eclipse. I'm fairly new and not sure what I need to back it up. Do I need just the project or do I need the meta data also? Thanks guys
If I'm understanding you correctly you want to make a backup of your project? If you've never used version control before, now would be a great time to start! Version control will not only provide you with what you're looking for but many other great features. There's plenty of different SCM's available for you to choose froml; Git, SVN, Mercurial and so on.
Otherwise if all you want is to copy the project to another location, open your eclipse workspace folder (the directory you defined when you first started eclipse) and copy the project directory from there. Or do as MarchingHome suggests.
I always directly copy the entire folder of the project in the eclipse workspace.
You can import that later in eclipse via File --> Import --> General --> Existing project into workspace.
You can there select the folder and everything will be restored.
Hope this helps.
As long as you work alone and on always the same machine, you can simply backup the entire project folder with the help of a version control system like git. This will help you keep track of all the changes you make and lets you undo any code changes. You can use github as a reliable remove service. If you aren't familiar with it yet, then it might take some reading to get into, but afterwards you life will be much easier.
You need the metadata. There are a few files in the top level project directory when you use eclipse: .cproject (this might only be if you use CDT plugin), .project and sometimes a .settings directory. Basically, you need all the dot files/dirs. You can just zip up the directory and that should be enough.
That said, if you try and open that project and the paths have changed, you'll probably get errors. Same for if you're missing vital plugins used by your project.
What you should be doing is using some sort of revision control. Try git or mercurial. Eclipse has plugins for them as well.