I'm trying to build this old app on the newest version of Android Studio that requires Gradle 1.10. I keep getting sync errors (See below).
SYNC ERROR:
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) (8 s 599 ms)
What versions/numbers should I have in my lines that are marked with ***.
buildscript {
repositories {
mavenCentral()
}
dependencies {
**** classpath 'com.android.tools.build:gradle:1.5.0'
}
}
apply plugin: 'android'
repositories {
mavenLocal()
mavenCentral()
}
android {
*** compileSdkVersion 19
*** buildToolsVersion "19.1"
defaultConfig {
*** minSdkVersion 10
*** targetSdkVersion 19
}
lintOptions {
abortOnError false
}
}
dependencies {
*** compile 'com.android.support:appcompat-v7:19.1.0'
*** compile 'com.bitalino:bitalino-java-sdk:1.0'
*** compile 'org.roboguice:roboguice:3.0b-experimental'
*** compile 'com.squareup.retrofit:retrofit:1.5.0'
}
SYNC ERROR: 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) (8 s 599 ms)
We came across several cases where the online distribution was not working as expected and failed the Gradle sync. Another workaround to this issue is to download the Gradle distribution manually and make use of that. Follow the steps below: Download the latest version of Gradle from the official Gradle Release Website.
After downloading, extract all the files to an accessible folder. Now launch Android Studio and go to File > Settings > Build, Execution, Deployment > Gradle. Now select the option of Local Gradle Distribution. Also, when in the Gradle home, point to the path where you just extracted the files.
Kept getting this error when I tried to import a file for a class I'm taking. Several days of digging and a little luck later, learned about gradle versions and Android Gradle Plug in versions. The numbers are not the same but they must correspond as per the table in this link: https://developer.android.com/studio/releases/gradle-plugin After I got that then I had to go into the build.gradle file and change it to this. My changes are annotated
// Top-level build file where you can add configuration options common to all sub-
projects/modules.
buildscript {
repositories {
google()//Add this
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'//change to this
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()//add this
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in the griddle-wrappers.properties file change
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
to
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
If you look at the table in the link you will see that the 4.1.0 in this build.gradle file line
classpath 'com.android.tools.build:gradle:4.1.0'
matches the 6.5-all in this gradle-wrapper.properties line
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
I didn't try it but I would imagine that as long as the numbers correspond to each other on the chart then it would work even if it weren't exactly these numbers.
Hope this helps you out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With