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
Related
I have recently created a new Android application and have used its VCS to integrate with GitHub. My problem is that although the integration appears to work, the only file in my Android application that has been saved to GitHub is MainActivity.java. I have tried to add files into GitHub but via the Website but this fails as there are too many files and it doesnt allow Folders to be added.
Has anyone else had this issue?
It's frustrating as when I make changes to MainActivity.java it gets saved and committed/pushed okay but the VCS in Android just doesn't see the other files I have changed such as the content_main.xml which I changed to see if it would then be added to GH.
I cannot seee how to add files within Android Studio to GH via VCS. Does anyone have any pointers where I may start? Thanks!
NB I have had a look through existing questions but none address my issue as far as I can tell.
Usually when you start a new project, Go on VCS -> Enable Version Controle Integration.
Then you should have the Version Control accessible on the Bottom Left of the IDE.
In the tab Local Changes, you will see Default and Unversioned Files.
Just take files from Unversioned Files to Default to start to track them.
To my shame once I checked Xiaomis suggestion I could see that my git was pointing to a directory lower than my /app directory. I tried to change in in my GitHub shell but was unable to do this as GitHub Desktop shell didn't recognise the new directory.
To fix my muddle I deleted my original repo and delted the .gitignore file and other git files from my Android project folder. I then opened Android Studio and went through the process of creating a new repo from there, circumventing GitHub entirely. This worked and enabled me to select my /app directory as the Git root.
Thanks go to Xiaomi who's suggestion made me notice that git was looking at the wrong root. Live and learn!
I have a project made in Android Studio that I wish to put into a GitHub repository. I used "Import into version control" -> "Share project on GitHub". Android Studio then made an empty repository on my GitHub account with the name that I specified. I simply cannot make an initial commit now that the repository is there. When I use VCS -> Git -> Commit file, it simply pops up a window that says "Nothing to commit.". I've tried making a new dummy file, and yet it still thinks there have been no changes. I've also tried selecting all of the files and using the "add" button, but this appears to do nothing whatsoever. How can I get this project on GitHub? My desire, specifically, is literally just to somehow commit my project in Android Studio into this GitHub repository it has created for me so that I can collaborate on this project with some friends. Thanks in advance.
If there is nothing to commit, Android Studio has already commited all your files locally. Now you need to VCS > Git > Push to upload your commits to your GitHub repository.
What ended up happening is I just created a new project, copied and pasted all of my code in, and then used the "Share Project on GitHub" button again. This time, for whatever reason, it worked seamlessly.
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
I just started using the Android Studio IDE and I already released and published a simple APK to Google Play store.
The problem is that I did this at work.
Now I downloaded the Android Studio at my home and I want to continue working and fixing bugs on my Project.
I see that there is Import Project in the Android Studio home screen, but from where I export the project in order to import it?
I tried Zipping my whole Project folder and import it but it didn't work very well.
In the Android Studio go to File then Close Project. Then take the folder (in the workspace folder) of the project and copy it to a flash memory or whatever. Then when you get comfortable at home, copy this folder in the workspace folder you've already created, open the Android Studio and go to File then Open and import this project into your workspace.
The problem you have with this is that you're searching for the wrong term here, because in Android, exporting a project means compiling it to .apk file (not exporting the project). Import/Export is used for the .apk management, what you need is Open/Close project, the other thing is just copy/paste.
As mentioned by other answers, as of now android studio does not provide this out of the box. However, there are ways to do this easily.
As mentioned by #Elad Lavi, you should consider cloud hosting of your source code. Checkout github, bitbucket, gitlab, etc. All these provide private repositories, some free, some not.
If all you want is to just zip the sources, you can achieve this using git's git archive. Here are the steps:
git init # on the root of the project folder
git add . # note: android studio already created .gitignore
git commit -m 'ready to zip sources'
git archive HEAD --format=zip > /tmp/archive.zip
Note: If you intend to send this by email, you have to remove gradlew.bat from zip file.
Both these solutions are possible thanks to VCS like git.
It seems as if Android Studio is missing some features Eclipse has (which is surprising considering the choice to make Android Studio official IDE).
Eclipse had the ability to export zip files which could be sent over email for example.
If you zip the folder from your workspace, and try to send it over Gmail for example, Gmail will refuse because the folder contains executable.
Obviously you can delete files but that is inefficient if you do that frequently going back and forth from work.
Here's a solution though:
You can use source control. Android Studio supports that. Your code will be stored online.
A git will do the trick. Look under "VCS" in the top menu in Android Studio.
It has many other benefits as well. One of the downsides though, is that if you use GitHub for free, your code is open source and everyone can see it.
Source control is best way to handle this problem, if you don't want to pay then try bitbucket
It's free, allows private repo for upto 5 members team.
Windows:
First Open Command Window and set location of your android studio project folder like:
D:\MyApplication>
then type below command in it:
gradlew clean
then wait for complete clean process. after complete it now zip your project like below:
right click on your project folder
then select send to option now
select compressed via zip
Apparently, there's a lot of "dead wood" in the "build" directories of a project.
Under linux/unix, a simple way to get a clean, private backup is to use the "tar" command along with the "--exclude=String" option.
For example, to create an archive of all my apps while excluding the build directories, I have a script that creates the following 2 commands :
cd $HOME/android/Studio
tar cvf MyBackup-2017-07-13.tar Projects --exclude=build
For Android Studio below 4.1:
From the Top menu Click File and then click Export to Zip File
For Android Studio 4.1 and above:
From the Top menu click File > Manage IDE Settings > Export to Zip File ()
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.