Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Android Studio project from another PC with different Gradle versions?

Tags:

android

gradle

I have an Android studio project that wrote in Android Studio version 1.3.2. Now in another PC with Android Studio 2.1.2 I want to import or open that project to it. But when I try, and while opening, error occurred with my Gradle version and want from me to download necessary Gradle version.

But for my reasons, I don't want to download new data with Android studio. how can I manually transfer old PC Gradle to new one? or is there simpler way to resolve that?

like image 251
Sadeq Shajary Avatar asked Aug 13 '16 07:08

Sadeq Shajary


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.


2 Answers

Method: 1

Try "File -> New -> Import Project"

or Create new project and copy-paste all project files(Java,XML,Resource) except gradle folder.

Method :2

Or After Import file just change 2.1.2 to 1.3.2

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
like image 164
Jamil Hasnine Tamim Avatar answered Sep 21 '22 02:09

Jamil Hasnine Tamim


Adding local Gradle to projects would be really helpful

1.Download Gradle http://www.gradle.org/downloads

2.Install

3.Set Gradle home to the install directory like below : enter image description here

there is sample project check it : https://github.com/foragerr/SO-35302414-local-gradle-plugin

like image 35
VahidHoseini Avatar answered Sep 20 '22 02:09

VahidHoseini