HttpPost NoClassDefFoundError (Android Pie)
Ganganaidu opened this issue · 4 comments
App crashing after targeting Android P(28)
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpPost;
at com.leanplum.internal.SocketIOClient$3.run(SocketIOClient.java:239)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.methods.HttpPost" on path:
DexPathList[[zip file "/data/app/com.app.app-7mh7jkxuR98XWVtPWAaEGQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.app.app-7mh7jkxuR98XWVtPWAaEGQ==/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.leanplum.internal.SocketIOClient$3.run(SocketIOClient.java:239)
is there any solution ?
NOTE: When i did some research i find out that , you need to include cleartextTrafficPermitted flag in your app.
Thanks for reporting this. This should be fixed in #237 (not in the latest release yet unfortunately)
@e7mac Any idea when this fix will be released? Also, what functionality is broken if we don't permit clearTextTraffic?
A work-around I'm using until this gets fixed at the SDK level is adding this block of code to my manifest file
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
@jeffbuswell Our next release is expected in the next few weeks but we unfortunately don't have a concrete date yet. The additions to the manifest file is the workaround we are currently recommending.
As for cleartext traffic - this should not affect anything in production. That is only an option for the development mode.