URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-activity-lifecycle?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-activity-lifecycle#1
In which task and step of the codelab can this issue be found?
App overview
Describe the problem
Build error:
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /Users/thaz/Library/Android/sdk
Steps to reproduce?
- Go to...
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: com.thoughtworks.gauge, com.vladsch.idea.multimarkdown, com.intellij.marketplace, org.jetbrains.kotlin
- Import...
android-basics-kotlin-dessert-clicker-app
- See error...
Press on "Run App" creates a build error.
Versions
Android Studio version: 4.1.1
API version of the emulator: ? App sent to physical device: Xiomi Redimi Note 7
Additional information
I don't know why but following steps fixes it:
Go to: build.gradle (Module: Dessert_Clicker.app)
Add: buildToolsVersion "30.0.3"
inside android {}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.android.dessertclicker"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
dataBinding true
}
}