如何将现有的 android 项目(build.gradle)打开到 android studio [英] How to open existing android project(build.gradle) into android studio

查看:36
本文介绍了如何将现有的 android 项目(build.gradle)打开到 android studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Android Studio 的新手.我有一个现有的 android 项目,它是从 android studio 构建的.现在我需要从 build.grade(该项目的文件)文件中open 该项目.我遵循了这一步文件-->打开-->build.gradle(来自现有项目)
但是它显示的处理窗口如下图所示,很长时间没有很好的响应.

I am new to Android Studio.I have an existing android project which was build from android studio. now I need to open that project from build.grade(that project's file)file.I followed this step File-->Open-->build.gradle(from that existing project)
But it shows the processing window as below image for so Long time doesn't responding well.

所以任何人对此有想法请帮助我.

So any one have idea about this please help me.

推荐答案

首先,我们需要你的 build.gradle

First, we need your build.gradle

其次,我可以从你到目前为止发布的内容中进行猜测.

Second, i can make a guess from what you have posted till now.

  • 通过检查依赖项区域来检查您的 build.gradle 是否存在项目目录中未使用或丢失的项目

正如我从使用类 org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1 的 com.android.support:support-v4 的错误列表版本可以理解的.将尝试另一种方法列出版本.此行为已被弃用,并计划在 gradle 2.0 中删除"这个.它可能与存储库有关.

as i can understand from "error listing versions of com.android.support:support-v4 using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in gradle 2.0" this.It may be related to repositories.

检查您在依赖项区域是否有这个.如果那里写了其他内容,请将其删除并添加我在下面写的正确内容.

Check whether you have this or not in dependencies area. If something else is written there, remove it and add the correct one that i wrote below.

dependencies {
    ...
    repositories {
        mavenCentral()
        mavenLocal()
    }
...
}

  • 我的另一个猜测是,你的 support-v4 库实现有问题
  • 检查你是否有

        dependencies {
    ...
            compile 'com.android.support:support-v4:22.2.0'
    ...
        }
    

    这与否.如果没有,请添加以我上面写的 compile 开头的行.和如果你有类似的东西,

    this or not. If not , add the line starts with compile that i wrote above. And If you have something like,

    编译项目(':support-v4')

    删除该行.

    这篇关于如何将现有的 android 项目(build.gradle)打开到 android studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆