To fully test your app's compatibility with Android P and begin using new APIs, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion as shown here:
android {
compileSdkVersion 28
defaultConfig {
targetSdkVersion 28
}
...
}
Set Up the Android P SDK