3

I'm trying to build an old app (Udacity Android Basic course, 2017) in My newest android studio (4.1.1). The old app requires:

  • Android SDK v23
  • Android Build Tools v23.0.2
  • Android Support Repository v23.3.0

So I install android build tools v23.0.2 but I am getting a sync error every time. Please help.

Gradle sync started

14:34  Gradle sync failed: Unsupported method: SyncIssue.getMultiLineMessage().
          The version of Gradle you connect to does not support that method.           To resolve the problem you can change/upgrade the target version of Gradle you connect to.
          Alternatively, you can ignore this exception and read other information from the model.
          Consult IDE log for more details (Help | Show Log) (17 s 149 ms)

Below is my build.gradle(:) file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

below is my gradle.wrapper.propertise file

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

below is my app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.android.quakereport"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
}
greybeard
  • 2,249
  • 8
  • 30
  • 66
Kunal Kayal
  • 43
  • 2
  • 8

1 Answers1

0

Changing only the classpath number didn't work for me. But the solution I found did:

https://github.com/udacity/ud839_Miwok/issues/215#issuecomment-716142250

I confirm the issue was fixed by making the below changes/additions in the following files:

build.gradle

and

gradle-wrapper.properties

In the build.gradle file I have added

maven { url 'https://maven.google.com/' name 'Google' } in both the buildscript and allprojects just below jcenter() and changed the classpath to classpath 'com.android.tools.build:gradle:4.1.0'

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    } }

task clean(type: Delete) {
    delete rootProject.buildDir }

and in the Gradle Properties I did the changes mentioned by @ Diver1rn and changed distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists distr
ibutionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

Hope this helps all the others who are stuck and want to fix this issue with a copy and paste solution only.

Benur21
  • 109
  • 7