This solved the problem for me: click on the project folder, then press Alt + Enter, go to Java Build Path, Libraries, click on add external Jar, add the .jar file located on "sdk \ platform \ android-23 \ optional \ org .apache.http.legacy.jar ", go to order and export mode and click on org.apache.http.legacy.jar, click OK and it will be allowed.
source share