简体   繁体   English

将来自Github的Android项目导入Android Studio

[英]Import Android project from Github into Android Studio

I have single Github repository containing several directories where each directory is "root" for another Android project. 我有一个包含多个目录的Github存储库,其中每个目录都是另一个Android项目的“根”目录。 I need to import to AS only one of the projects. 我只需要将一个项目导入AS。 When I creating new project in AS from Github I can insert only the repository URL. 从Github在AS中创建新项目时,我只能插入存储库URL。 So I get in the project tree in AS one module which is the Github repository with several folders each one of them assigned with different Android project. 因此,我进入了一个模块AS的项目树,该模块是Github存储库,其中包含几个文件夹,每个文件夹分配有不同的Android项目。 The problem is those folders are not Modules and therefore I cannot threat them as Android project. 问题是这些文件夹不是模块,因此我不能将其作为Android项目威胁。

How can I change this? 我该如何更改?

Note - I cannot make any changes in the Github structure. 注意-我无法在Github结构中进行任何更改。

Android Studio and Eclipse have different workspace. Android Studio和Eclipse具有不同的工作区。

In the Eclipse workspace you can define more projects. 在Eclipse工作区中,您可以定义更多项目。

In the Android Studio workspace you can define 1 project with more modules. 在Android Studio工作区中,您可以定义1个具有更多模块的项目。
Each project have the build.gradle and settings.gradle files, and each module has a own build.gradle file. 每个项目都有build.gradlesettings.gradle文件,每个模块都有自己的build.gradle文件。

In your case, in each root folder of your project you have to define some files, like build.gradle and settings.gradle in which you define the single modules used by the project. 在您的情况下,必须在项目的每个根文件夹中定义一些文件,例如build.gradlesettings.gradle在其中定义项目使用的单个模块。

Somenthing like this: 像这样的东西:

github repo
 root
 |---module
 |------build.gradle
 |settings.gradle
 |build.gradle

 root1
 |---module
 |------build.gradle
 |settings.gradle
 |build.gradle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM