Cannot resolve Build.VERSION_CODES.Q with build tools 29 in Android Studio

Set your compileSdkVersion to 29 or higher. The buildToolsVersion (if you still have that) does not have an impact on the Android SDK symbols — that is determined by your compileSdkVersion.


To fix it, you need to update your compileSdkVersion to 29. While you are at it, might as well update the buildToolsVersion. You can do that by changing these lines in your /android/build.gradle file.

...
buildscript {
    ext {
        ...
        buildToolsVersion = "29.0.3"
        compileSdkVersion = 29
        ...
    }
...

What you can also do is revert your gradle version to 3.5.0, and keep the compileSdkVersion on 28. So, in android/build.gradle:

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

and in your android/app/build.gradle:

...
android {
    compileSdkVersion 28
    ...
}

Versions other than 3.5.0 might work as well, but I haven't tested them.