如何将现有的android项目(build.gradle)打开到android studio中

时间:2023-01-27 10:11:08

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.

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

So any one have idea about this please help me.

所以任何人都有这个想法,请帮助我。

如何将现有的android项目(build.gradle)打开到android studio中

1 个解决方案

#1


1  

First, we need your build.gradle

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

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

其次,我可以猜测你到目前为止所发布的内容。

  • Check your build.gradle for unused or missing projects in your project directory by checking dependencies area
  • 通过检查依赖项区域,检查build.gradle中项目目录中未使用或缺少的项目

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.

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

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()
    }
...
}
  • and my another guess is, there is something wrong in your support-v4 library implementation
  • 而我的另一个猜测是,你的support-v4库实现有问题

check whether you have

检查你是否有

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

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

这个与否。如果没有,请添加以我在上面编写的编译开头。如果你有类似的东西,

compile project(':support-v4')

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

remove that line.

删除该行。

#1


1  

First, we need your build.gradle

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

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

其次,我可以猜测你到目前为止所发布的内容。

  • Check your build.gradle for unused or missing projects in your project directory by checking dependencies area
  • 通过检查依赖项区域,检查build.gradle中项目目录中未使用或缺少的项目

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.

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

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()
    }
...
}
  • and my another guess is, there is something wrong in your support-v4 library implementation
  • 而我的另一个猜测是,你的support-v4库实现有问题

check whether you have

检查你是否有

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

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

这个与否。如果没有,请添加以我在上面编写的编译开头。如果你有类似的东西,

compile project(':support-v4')

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

remove that line.

删除该行。