cocos2d-x-3.9 eclipse problem/solution

Problem:
File Cocos2dxDownloader.class will not compile
import com.loopj.android.http.AsyncHttpClient; is not resolved
Solution:
Right click on project
Select Properties
Select Java Build Path
Select Libraries
Click on Add External Jar
Open E:\cocos2d-x\cocos\platform\android\java\libs\android-async-http-1.4.8.jar
This should fix the problem

Good luck
Andre

1 Like

My solution for gradle:

dependencies {
compile ‘com.loopj.android:android-async-http:1.4.8’
compile ‘org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2’
}

The apache http client line is needed if you’re using android api >= 23.

In which file do you enter this information?
Is this using Eclipse?

No, sorry, this is using gradle with Android Studio. Should have added this info in my post.
So in your build.gradle file you would add this.