My gradle file:
apply plugin: \'com.android.application\'
android {
useLibrary \'org.apache.http.legacy\'
compileSdkVersion 23
buildToolsVersion \
Why? If you use Android Studio on Windows then optional.json file should be not only in \Program Files (x86)\...\platforms\android-23\optional\ .
So: go to Android Studio Settings -> Appearence & Behavior -> System Settings and look for Android SDK Location, copy (or create) optional.json in corresponding folder.
Or just edit Android SDK Location to \Program Files (x86)\...
In my case Android SDK Location was C:\Users\Usernade\AppData\Local\Android\sdk and there was no optional.json file.