git android studio project,Import Android Studio project from git into Android Studio (Gradle)

阅读: 评论:0

git android studio project,Import Android Studio project from git into Android Studio (Gradle)

git android studio project,Import Android Studio project from git into Android Studio (Gradle)

问题

I've been reading this for hours now and everyone seems to have a different approach or that the tutorials are out of date.

Android Studio .gitignore only includes the app directory, this is on purpose. For what reason I do not know. When trying to clone the git repo Android Studio does not know how to handle it. A very annoying flaw in Android Studio.

What should be in my .gitignore for an Android Studio project?

I have a remote git repo containing the project in the form:

as you can see the git repo contains the /app directory.

I then try to import it via Check out project from Version Control and select git:

Everything works, the Test is successful and then I click on Clone:

The next part I press Yes as git did not clone the entire project but just the essential source files:

This is the part where I am lost, I am guessing I am to create the project via Gradle, so I select Gradle and press Next:

What am I supposed to do here, there are apparently gradle files on the net but which one am I supposed to use:

Create project from existing sources

If I choose Create project from existing sources I get the following problem:

Results in this, I was expecting app directory:

File structure (as you can see fela is missing a lot of files, this is when I chose create project from existing sources, MyApplication is an example of an app which was created in Android Studio):

回答1:

The answer is obvious when looking at the .gitignore file of a newly created project. adle file is and should be included in the push to the remote repo.

So the person who made the repo in my question is doing it wrong. The .gitignore file includes:

.gradle

/local.properties

/.l

/.idea/libraries

.DS_Store

/build

/captures

As seen, more files should of been uploaded to the remote repo.

回答2:

Choose Existing Sources instead of Import

回答3:

IF your project is showing error like The project 'xxxxxxx-xx' is not a Gradle-based project then check this link. I hope it helps. This link might cover your possible problem. Let me know the progress.

来源:

本文发布于:2024-02-02 16:25:18,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170686231945000.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:studio   project   git   android   Studio
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23