Unsupported method: BaseConfig.getApplicationIdSuffix()

后端 未结 9 2030
挽巷
挽巷 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:13

    I did the following to make this run on AS 3.5

    1. app/ build.gradle

      apply plugin: 'com.android.application'

      android { compileSdkVersion 21 buildToolsVersion "25.0.0"

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

      }

    dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:21.0.0' implementation 'com.squareup.picasso:picasso:2.71828' }

    1. build.gradle

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

    2. gradle-wrapper.properties

      distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip

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

    For Android Studio 3 I need to update two files to fix the error:--

    1. app/build.gradle

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

    2. app/gradle/wrapper/gradle-wrapper.properties

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

    Alright I figured out how to fix this issue.

    • Open build.gradle and change the gradle version to the recommended version:
      classpath 'com.android.tools.build:gradle:1.3.0' to
      classpath 'com.android.tools.build:gradle:2.3.2'
    • Hit 'Try Again'
    • In the messages box it'll say 'Fix Gradle Wrapper and re-import project' Click that, since the minimum gradle version is 3.3
    • A new error will popup and say The SDK Build Tools revision (23.0.1) is too low for project ':app'. Minimum required is 25.0.0 - Hit Update Build Tools version and sync project
    • A window may popup that says Android Gradle Plugin Update recommended, just update from there.

    Now the project should be runnable now on any of your android virtual devices.

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