[英]How to import an existing project from GitHub into Android Studio
I've just imported EdgeEffectOverride project from Github into Android Studio. 我刚刚从Github导入EdgeEffectOverride项目到Android Studio。 This is the screen shot 这是屏幕截图
When I run the project, I get the error: Error running build: Module 'EdgeEffectOverride-master' is not backed by gradle
. 运行项目时,出现错误: Error running build: Module 'EdgeEffectOverride-master' is not backed by gradle
出错: Error running build: Module 'EdgeEffectOverride-master' is not backed by gradle
。
You can directly import github projects into Android Studio. 您可以直接将github项目导入Android Studio。 File -> New -> Project from Version Control -> GitHub. 文件->新建->版本控制中的项目-> GitHub。 Then enter your github username and password.Select the repository and hit clone. 然后输入您的github用户名和密码,选择存储库并点击克隆。
The github repo will be created as a new project in android studio. github存储库将作为android studio中的新项目创建。
Unzip the github project to a folder. 将github项目解压缩到一个文件夹中。 Open Android Studio. 打开Android Studio。 Go to File -> New -> Import Project . 转到文件->新建->导入项目 。 Then choose the specific project you want to import and then click Next->Finish. 然后选择要导入的特定项目,然后单击“下一步”->“完成”。 It will build the Gradle automatically and'll be ready for you to use. 它会自动构建Gradle,并可供您使用。
PS: In some versions of Android Studio a certain error occurs- PS:在某些版本的Android Studio中,会发生某些错误-
error: package android.support.v4.app does not exist. 错误: 程序包android.support.v4.app不存在。
To fix it go to Gradle Scripts->build.gradle(Module:app) and the add the dependecies: 要修复它,请转到Gradle Scripts-> build.gradle(Module:app)并添加依赖项:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
Enjoy working in Android Studio 享受在Android Studio中工作的乐趣
In Github click the "Clone or download" button of the project you want to import --> download the ZIP file and unzip it. 在Github中,单击要导入的项目的“克隆或下载”按钮->下载ZIP文件并解压缩。 In Android Studio Go to File -> New Project -> Import Project and select the newly unzipped folder -> press OK. 在Android Studio中, 转到文件->新建项目->导入项目, 然后选择新解压缩的文件夹->按确定。 It will build the Gradle automatically. 它将自动构建Gradle。
Good Luck with your project 祝您项目顺利
Steps: 脚步:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.