Reputation: 2731
When i debug my app it is working fine but when i try to export my apk and install it i am getting this issue:
java.lang.NoClassDefFoundError: org.apache.http.params.SyncBasicHttpParams
at aig.a(Unknown Source)
at ahy.q(Unknown Source)
at ahy.d(Unknown Source)
at ahy.r(Unknown Source)
at ahy.c(Unknown Source)
at ahy.a(Unknown Source)
at ahy.a(Unknown Source)
at ahy.execute(Unknown Source)
at com.application.Login.a(Unknown Source)
at com.application.Login.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2248)
at android.app.ActivityThread.access$600(ActivityThread.java:145)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5095)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)
I am using proguard,
I have added reference libs also like this:
-libraryjars /libs/org.apache.httpcomponents.httpclient_4.2.1.jar
-libraryjars /libs/signpost-commonshttp4-1.2.1.1.jar
-libraryjars /libs/signpost-core-1.2.1.1.jar
-libraryjars /libs/signpost-jetty6-1.2.1.1.jar
-libraryjars /libs/twitter4j-core-2.1.6.jar
any idea..@thanks
Upvotes: 3
Views: 5270
Reputation: 45678
In the standard Android builds (Ant, Eclipse, Gradle), don't specify -libraryjars or -injars, since the build scripts will already specify those for you. Just make sure you add all necessary library jars to the libs directory, as usual, so the build scripts will include them.
In Eclipse, libraries may need to be marked as Exported.
Upvotes: 1
Reputation: 2805
There is no HttpCore in your libs.
Please import HttpCore
This link is HttpCore 4.1, You can search HttpCore 4.2 or 4.3 if you want.
In the future, when you import a library please ensure that you import the relevant library
Upvotes: 2
Reputation: 29438
Add the following lines to you proguard-project.txt
file:
-keep class org.apache.http.** {
*;
}
I would also suggest you to use repackaged version of HttpClient for Android instead of original HttpClient jar to avoid class loading collisions with the version bundled with Android. But as far as I can see you'll also need to rebuild Signpost HttpClient module to use ch.boye.httpclientandroidlib
package instead of org.apache.http
(and don't forget to update package name in proguard-project.txt
as well).
Upvotes: 2
Reputation: 10563
Import the package on your bundle
Import-Package: org.apache.http.params
Upvotes: 1