Just installed cocos2dx 3.9 and I can't compile android

Hi all, I just installed cocos2dx v3.9 and am getting this error when trying to compile with android

cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxDownloader.java:9: error: package org.apache.http does not exist
[javac] import org.apache.http.Header;

there are about 12 of these errors all seeming to relate to org.apache.http

Does anyone know what is going on? I’m trying to build a fresh project without anything added using the console. Thanks in advance,

Matt

I had this same error today. I managed to get it working by downloading/installing an older version of the Android SDK (22.1.0) instead of the most recent (24.4.1). After that, I ran this command and it worked fine:

$ cocos run -p android --ap android-22

Hope that helps!

Only works on SDK version 22. but you have to change the internal cocos java project. Execute this on your project folder:

android update project -p cocos2d/cocos/platform/android/java -t android-22

Likewise, to get cocos compile -p android -ap android-10 -m release to work, I needed to a) run the sdk tool, android and get android 10 deps, and then run C:\Users\USERNAME\AppData\Local\Android\Sdk\tools\android update project -p cocos2d/cocos/platform/android/java -t android-10 to update my project files or whatever.

Hope this helps someone.

android-ndk-r10c, cocos2d-x-3.10, android sdk 25.