Android-23 (6.0) - compile errors: import org.apache.http.Header

This person in this thread is having the same compile error as us.

We are trying to compile for Android 6.0 with the “cocos” command in the command prompt.

System info:
Cocos 3.10, NDK r10e, SDK tools 24.4.1, Andorid 6.0 (API 23).

Error: import org.apache.http.Header

We have tried downloading “httpclient-4.5.1.jar” and “httpcore-4.4.3.jar” and put them in the “proj.android\libs” folder.

What are we doing wrong?

Really thankful for an answer.
:smile:

Solved it. We needed to copy a file into our project.

Instructions if anyone else have this problem:

Copy from this folder where you have your Android SDK:
[YOUR DRIVE LETTER]:\adt-bundle\sdk\platforms\android-23\optional

Name of the file to copy:
org.apache.http.legacy.jar

Copy this file into your project folder at location:
[YOUR PROJECT PATH]\cocos2d\cocos\platform\android\java\libs

Now the project can build with the org.apache.http.legacy.jar file and compilation succeeds.

1 Like