Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open existing android project(build.gradle) into android studio

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.

enter image description here

like image 400
Manoj Avatar asked Sep 03 '14 13:09

Manoj


People also ask

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Where is the build Gradle File in Android Studio?

gradle file is located inside your project folder under app/build. gradle.

How do I import a Gradle project into Android Studio?

Import as a project: Start Android Studio and close any open Android Studio projects. From the Android Studio menu click File > New > Import Project. Alternatively, from the Welcome screen, click Import project (Eclipse ADT, Gradle, etc.).

How to open an existing Android Studio project?

Just click the file name in recent projects which you want to open. Step 1: Open Android Studio. After that you Click on “Open an existing Android Studio project”. Step 2: After that Select the File location where your file is located. We located and selected “HelloAbhiAndroid” project and then Click OK.

What is the difference between Gradle Android project and IntelliJ IDEA?

I have used IntelliJ Idea for ant based project and gonna use Android Studio with Gradle android project Project name is SenZors. It contains src, res, lib, asserts etc Main project contains build.gradle and settings.gradle file A project is a complete android app. Projects can consist of one or more modules.

How do I change the project structure in Android Studio?

Navigate to the location you selected for your new project and move the code, unit tests, instrumentation tests, and resources from your old project directories into the correct locations in your new project structure. In Android Studio, click File > Project Structure to open the Project Structure dialog.


1 Answers

First, we need your 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

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()
    }
...
}
  • and my another guess is, there is something wrong in your support-v4 library implementation

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')

remove that line.

like image 59
Dave Doga Oz Avatar answered Oct 25 '22 02:10

Dave Doga Oz