Import an eclipse android project with version control system into Android Studio

后端 未结 3 1459
夕颜
夕颜 2020-12-01 03:58

I am trying to import an eclipse project with version control system into Android Studio.

Support for direct eclipse project import was added in Android-Studio vers

3条回答
  •  佛祖请我去吃肉
    2020-12-01 04:34

    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.

    1. Clone git repository of project
    2. Add /gen and /.idea to .gitignore
    3. Open any of already created Android Studio projects.
    4. File -> Open -> Choose path root project folder(with src and res inside)
    5. Doble-click project to open project structure
    6. Select root project folder -> F4
    7. Project -> Project SDK -> Android API XX Platform && Project language level -> Override in interfaces
    8. Modules -> Sources tab. Mark src as Sources && res as Resources.
    9. 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
    10. 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)
    11. Facets -> "+" -> Android
    12. Facets -> Structure tab -> Reset to defaults.
    13. Close Project Structure window.
    14. Run -> Edit configurations -> Android Application -> Module -> Select your module.Target device -> Show chooser dialog.
    15. Edit configurations -> Before launch -> remove Gragle aware make, add Make.

    Finally, after all of those steps you are able to hit Run button.Enjoy!

提交回复
热议问题