git eclipse pulls no project - android

I am new to working with repositories.
I'm forced to work with my team on academic project using git. My job is to write Android app.
The problem is when I wrote it, then pushed it to repo I want to pull it on different machine.
But when I pull it, I get only "source" files, no: (for example) R.java.
Moreover: I wanted to use "Clean project" Option, but it seems, that my Eclipse is not treating the pulled files as project (when I click "Clean..." I can choose any project in my workspace, but the download one is lacking).
Anyone could help me?
EDIT:
I've solved the problem:
Git doesn't push to repository automatic-generated files, like R.java. After you pull it back, you have to Clear project and rebuilt it. If it still doesn't work: try restarting Eclipse

Related

Does changing an Android Studio project to another folder cause problems?

I was working on an Android app, and decided to do an initial git commit. The project folder was on my desktop so I moved it into a newly created folder as to not make the Desktop into a git repository. The project was open in Android Studio when I moved it and made the commit, and when I went back to it it didn't work.
I closed it and reopened it and it wouldn't compile (I was a fool and didn't screen shot the error message) but then it started to work.
However, all the files in the project are in red, not the code itself, just the files that a visible in the tab on the left and the tabs at the tops of the open files. The project works but I want to get rid of the red as obviously it's an indication that something's not right.
I have to send this project for review tomorrow and I hope this won't create an issue for the recipient.
Thanks
The files are red because they have not been committed to git.
git add . and git commit -m "your commit message" should fix it.
And No it should not be a problem. I suggest you read more about git, it's a cool tool

Cloning AS Project Gradle Error

I'm trying to clone my remote repository for the first time.
I usually work on a desktop, but need to work on a laptop for the time being.
I know that I must have not included the proper gradle files in my pushes. I'm just trying to figure out exactly what I did wrong and find a way to fix it.
I won't be able to get back to my normal workstation until the weekend.
A link to my project on github here
After AS asks me to import project from VCS, it asks to create project from existing files or an external model. I've tried both, but I think the existing files option is what I'm supposed to do. After choosing that, I get the "Migrate Project to Gradle? This project does not use the gradle build....".
I've found quite a few posts about this topic, but none of them seem to be exactly what I'm going through.
It looks like a bunch of files are missing in the root of the project. Normally there is a master build.gradle at the same level as app that directs the build. This project doesn't have one.
What I would do is create a new project from scratch in a different space and copy its build.gradle, gradlew, gradle.bat, settings.gradle, and .gradle directory into a clean clone of your project and try again, choosing the root of your project as the import location.
I don't 100% guarantee this will work as there may have been modifications made to any of those file that may have been lost, but this should bootstrap your project again.
Also make sure a .gitignore isn't somehow ignoring these files so you can commit them back to your project. They really do need to live in source control.

Recover Deleted Git Repository from Eclipse

I am stuck here and in extreme need to expert advise
I have created an Android project in Eclipse and was in the process of creating a git repository for it using EGit.
I have gone through the normal process of creating a repo in Eclipse: right-click project -> Team -> Share Project
I gave the repo a name and hit continue to create it.
The progress bar started flashing but in the middle i got a problem creating the repo. I do not remember what the issue was but i decided to delete that repo and start from scratch.
So i went to Git Repositories in Eclipse and hit delete repo. I checked the box that says delete existing files in the repo. And unfortunately, the whole Android project was deleted from Eclipse :(
i was not aware that by creating a repo the original files will be copied over to the repo folder and removed from the workspace :'(
Does any one know an approach to recover that deleted repo/project?
Many thanks
I had the same problem, deleted project so there is no "Recover from local history" button to click, and no local windows history, but you can do a manual recover from history.
I tried this solution in Eclipse Oxygen/Windows 10,
First of all, eclipse store history file at here,
(workspace)/.metadata/.plugins/org.eclipse.core.resources/.history/
and there is a lot of file with long name like this '006de3225c86001811b7ff2e93138537', that's the history file eclipse using to recover, you can search the text inside those file for the package name of the deleted project, then you can pick the latest one, copy past it to the new project location, renaming them to the correct file name. This approach is complex, but works for me.
In eclipse there is an option for projects. Right of project and see : "Recover from local history". This should help you
If you deleted your git repository permanently and it is showing that there is no project or file on eclipse window .
Then go to your current workspace of eclipse and search these file name there, you got all of your file there and you can see every folder and files of that project.
The workspace of eclipse is in C:/User/name/workspace/current_workspace_name/project_name

I deleted my git project from Eclipse, how can I open it again and sync?

I just used Eclipse and Egit in order to make my first open source project.
This was working pretty well and I made some commits and push during a few weeks.
Now, I have my Android project in my git folder (localy) with some unpushed commits.
Due to some bad manipulations, I removed my project from Eclipse, and I would like to import ir again and push the commits I made.
First thing I tried was to "import" an existing project and pointed the folder of my application, that worked but I lost all my "team" tab and cannot push again.
all the git informations are not linked. (no commits, no push,...)
I also tried to start a new project and choose "from existing source" but with the same result.
Thank a lot for any help.
I will answer myself.
I had to right click on the project, select team, then share.
At this place I had to fill with Github repository, was not so intuitive, but I did it.

android eclipse driving me mad?

I've quite new to Android development and specially Eclipse.
I'm busy on a project called, say 'HelloEclipse'. I've had some major changes ahead, in which I had to some very big changes.
So I made a zip file of c:\workspace\HelloEclipse, placed that in a save place. Went on to work on my project. Few hours later, I wanted to go back to the saved situation. Closed Ecplise, rebooted my computer, because I wanted to make sure there were no locked files. Deleted the old c:\workspace\HelloEclipse folder, place the version out of the ZIP file back.
This resulted in a totally corrupted workspace status. Could not go foward, nor backward. I've ended up, creating a new project, and pasted in everything, took me hours. I think this is quite stupid Eclipse behavior. I've also tried ot, export/import with a archive from out of Eclipse, also not succesfull.
So the two questions;
How am I suppose to save projects (without installing anything like subversion)?
Why is saving the files not enough, and why does that make Eclipse barf?
Thanks in advance!
Dennis
In eclipse if you want to reimport an old project from a ZIP, don't just copy the project files to the workspace, instead, extract the files to a normal dir outside the workspace.
Open Eclipse normally and select File>New Project>Android Project, just as you would to to create a new Android project, but then in the new android project window, you have a radio button giving you the choice to Create project from existing source, point it to the directory where you have extracted your old project and it should be re-imported to the WorkSpace alright.
Or do File>Import>Import existing project into workspace.
But in any case, don't put the files in the workspace manually to avoid conflicts, Eclipse will copy the files it needs itself upon importing.
There are hidden workspace files that you may have missed -- specifically, .classpath and .project. That said, it's a lot easier to make a backup copy (for example, of a released version so you can continue developing while supporting the release) by simply right-clicking on the top-level of the project in Eclipse and selecting Copy, then right-clicking and selecting Paste. The result will be a copy of the project after an opportunity to name the copy.
If you want to zip projects, you can do that by exporting them. If you want to delete existing projects, you should do that from inside Eclipse with a right-click. You can import the zip you previously exported.
If by save, you meant backing up the best something would be to create a local repository. If I were you, I would backup my code in an online repository too; to save it from hardware crashes or other disasters.
In your problem, you could have tried deleting the project alone and import the backup copy(from the zipped file) instead of deleting the entire workspace. Can't pinpoint the exact reason of why eclipse barfed but maybe because it messed up the workspace settings for eclipse. On a related note, I found this on the net.
Eclipse is rather troublesome at times but AFAIK it's the best IDE for android.
First of all, after several months of developing with eclipse I moved to IntelliJ (they have a community edition) and I found it much much better.
In intelliJ you can save local history, for example, you can set-up a label and go back to that label whenever you like without losing anything.
As for eclipse, you probably didn't zip some hidden files or something.
In addition, I remember having some similar problem, I had to resync the files with the project, try this one
Good Luck
I do the same thing with my projects. Instead of going through windows explorer to copy the files, I find copying the entire project from within Eclipse (right click the project in the explorer window pane, click copy, then click outside of the project and click paste) works just fine. When you paste it, you can specify a new save location and project name, which can be your backup space. Then you can switch between versions of the project no problem.

Categories

Resources