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
I did the following to make this run on AS 3.5
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' }
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() } }
gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
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
Alright I figured out how to fix this issue.
classpath 'com.android.tools.build:gradle:1.3.0'
toclasspath 'com.android.tools.build:gradle:2.3.2'
'Try Again'
'Fix Gradle Wrapper and re-import project'
Click that, since the minimum gradle version is 3.3
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
Android Gradle Plugin Update recommended
, just update from there.Now the project should be runnable now on any of your android virtual devices.