When you update your android SDK version to a higher version, you may encounter the 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 to follow the below steps.
- In android studio, click Tools —> Android —> SDK Manager.
- Click the Android SDK menu item in the left panel.
- Click the SDK Platforms tab in the right panel and check the required android API checkbox in the SDK Platforms tab list.
- Make sure the checkbox before the Android API is checked, click the OK button, it will popup a dialog which tells 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 is complete, click the Finish button and restart android studio if required. Then the problem has been fixed.
- You can also check the Show Package Details checkbox in the bottom right corner of the step 4 dialog, then select your desired SDK version and deselect the SDK version that you do not want, then click the OK button to update, this action can make your project SDK version more clearly.