When you update your android sdk version to higher version, you may encounter below errors when you edit exist java files in android studio.
The SDK platform-tools version (26.0.1) is too old to check APIs compiled with API 27; please update
To resolve this error, you just need follow below steps.
- In android studio, click Tools —> Android —> SDK Manager.
- Click Android SDK menu item in left panel.
- Check the required android API in right panel SDK Platforms tab.
- Make sure the checkbox before the Android API is checked, click OK button, it will popup a dialog which tell you that it will install the selected components, click OK in the popup dialog.
- Then android studio will download and install the selected component, when the process complete, click Finish button and restart android studio if required. Then the problem has been fixed.
- You can also check Show Package Details checkbox in step 4 dialog, then select your desired sdk version and deselect you do not wanted sdk version then click ok to update, this action can make your project sdk version more clearly.