How To Import Eclipse Project From Git To Android Studio?
Solution 1:
Here is the step by step solution to do it. You can use your eclipse code directory for it.
- Open Android Studio -> Import Project-> Select your project directory. (In above case "MyApp") Remember Select the directory which contains Manifest file otherwise new "direct import wizard" doesn't get triggered and android studio uses old import wizard.
- Android Studio will create a copy of your project "MyApp_imported" with new directory structure.
- Copy your existing ".git" directory inside "MyApp_imported"
- Android Studio -> VCS -> Enable version control This will make Android Studio use your existing repository for imported project. Though imported project has different directory structure but git handles them pretty well.
- Android Studio -> Changes Review all files and commit. Git will automatically handle new directory structure and file history etc will not be lost.
- Now you can share it on github/Bitbucket by VCS-> Share it on GitHUb Note:- For bitbucket you will have to install "following Bitbucket plugin" for Android Studio. http://plugins.jetbrains.com/plugin/6207?pr=androidstudio
Here are more details about it: Import an eclipse android project with version control system into Android Studio
Solution 2:
Couple of months ago I got my job as android developer.The first problem i had faced were my collegues who using Eclipse.I was allowed to use Android studio if I will not make any changes to existing project structure.After 3-4 attemps I finally found a decision.Here is steps to open Eclipse git project without migrating to Gradle and without changing project structure.
- Clone git repository of project
- Add /gen and /.idea to .gitignore
- Open any of already created Android Studio projects.
- File -> Open -> Choose path root project folder(with src and res inside)
- Doble-click project to open project structure
- Select root project folder -> F4
- Project -> Project SDK -> Android API XX Platform && Project language level -> Override in interfaces
- Modules -> Sources tab. Mark src as Sources && res as Resources.
- Modules -> Paths tab. Use module compile output path.Create folders output and output_test inside gen folder (create gen if folder not exist yet).Output paths should look like C:\Users\User\project_rep\project\gen\output
- Modules -> Dependencies tab. Click "+" -> Jars or directories.Select all .jar libraries which are using by your project.(Android Studio can pretend like its added only one jar but thats not true)
- Facets -> "+" -> Android
- Facets -> Structure tab -> Reset to defaults.
- Close Project Structure window.
- Run -> Edit configurations -> Android Application -> Module -> Select your module.Target device -> Show chooser dialog.
Finally, after all of those steps you are able to hit Run button.Enjoy!
Solution 3:
You can start checking if this tutorial can help, after enabling Git in Android Studio:
If you then import into Android Studio your Eclipse project (already in a cloned git repo), you should see the Git options available for your project files.
Post a Comment for "How To Import Eclipse Project From Git To Android Studio?"