Build Failure: Unable to list target platforms - Unity 2017.1.4p2

I tried building my Android prototype in Unity 2017.3.1f1, there was the same error so I googled and found that I should do a downgrade of SDK tools to version 25.2.5, so I did and it still didn’t work.
Then I downloaded the latest Unity 2017.1.4p2 and updated SDK tools through Android Studio to 26.1.1 but still doesn’t work.

Here are the screenshots of error:
119453-screenshot-3.jpg

Download android studio. Within android studio, upgrade sdk. Also on player settings put a more recent version for android. Did you put a correct path for the sdk?

Unity is telling you it can’t find the SDK, so go to Edit → Preferences → External Tools and make sure the SDK path is correct. Also, install android studio and upgrade the SDK to the newest version.

What I did is that I renamed tools (26.1.1) to tools_old and in the same directory put tools (25.2.5), it works now