Unsupported method: BaseConfig.getApplicationIdSuffix()

后端 未结 9 2029
挽巷
挽巷 2020-12-04 04:58

So I\'m reading Android 6 for Programmers: An App-Driven Approach and the first two app examples I had no issues with the examples, this time the FlagQuiz example w

相关标签:
9条回答
  • 2020-12-04 05:04

    Change your gradle version or update it

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
    

    alt+enter and choose "replace with specific version".

    0 讨论(0)
  • 2020-12-04 05:05

    If this ()Unsupported method: BaseConfig.getApplicationIdSuffix Android Project is old and you have updated Android Studio, what I did was simply CLOSE PROJECT and ran it again. It solved the issue for me. Did not add any dependencies or whatever as described by other answers.

    0 讨论(0)
  • 2020-12-04 05:10

    First, open your application module build.gradle file.

    Check the classpath according to your project dependency. If not change the version of this classpath.

    from:

    classpath 'com.android.tools.build:gradle:1.0.0'
    

    To:

    classpath 'com.android.tools.build:gradle:2.3.2'
    

    or higher version according to your gradle of android studio.

    If its still problem, then change buildToolsVersion:

    From:

    buildToolsVersion '21.0.0'
    

    To:

    buildToolsVersion '25.0.0'
    

    then hit 'Try again' and gradle will automatically sync. This will solve it.

    0 讨论(0)
  • 2020-12-04 05:10

    You can do this by changing the gradle file.

     build.gradle > change
        dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        }
        gradle-wrapper.properties > update
        distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
    
    0 讨论(0)
  • 2020-12-04 05:13

    In my case, Android Studio 3.0.1, I fixed the issue with the following two steps.

    Step 1: Change Gradle plugin version in project-level build.gradle

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

    Step 2: Change gradle version

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
    
    0 讨论(0)
  • 2020-12-04 05:13

    I also faced the same issue and got a solution very similar:

    1. Changing the classpath to classpath 'com.android.tools.build:gradle:2.3.2'

      Image after adding the classpath

    2. A new message indicating to Update Build Tool version, so just click that message to update. Update

    0 讨论(0)
提交回复
热议问题