Android Gradle - Error:Unsupported method: Baseconfig.getApplicationIdSuffix()

Asked

Viewed 4,015 times

3

When importing a Github project using the Android Studio 3.0.1 I got the following error in Gradle:

Error:Unsupported method: Baseconfig.getApplicationIdSuffix(). 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.

I’ve tried to make these changes, but I didn’t succeed: https://stackoverflow.com/questions/44546849/unsupported-method-baseconfig-getapplicationidsuffix

I’m new on android. I still don’t understand much about Gradle. Below follows the states of my Gradle files in Android Studio 3.0.1

Any help is much appreciated.

build.Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "luck.materialdesign.tabsnavigator"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.android.support:support-v4:21.0.3'
    compile 'de.hdodenhof:circleimageview:1.2.2'
    compile 'com.mcxiaoke.volley:library:1.0.15'
}

local properties.:

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sat Jan 27 00:26:41 BRST 2018
sdk.dir=/Users/user/Library/Android/sdk

Gradle-wrapper-properties:

#Sat Jan 27 01:01:59 BRST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

1 answer

3


I was able to solve it with this way.

Edit the build.Radle file to use an older version: classpath 'com.android.tools.build:gradle:2.3.2'

inserir a descrição da imagem aqui

I downloaded an older version of Gradle here: https://services.gradle.org/distributions/

Extract and paste content into Android Studio’s Gradle folder, Mac path is Applications > Android Studio > Contents > Gradle

inserir a descrição da imagem aqui

Now force Android Studio to use the older version of Gradle by changing the settings.

inserir a descrição da imagem aqui

After a Build > Clean Project and Rebuild Project

inserir a descrição da imagem aqui

Android will ask you to upgrade to a newer version. Ignore this message.

From now on you should already be able to work on your application.

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.