0

I need update my app to support android targetSdkVersion 28 with shephertz app42 cloud api. But I get a error: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/params/BasicHttpParams; at com.shephertz.app42.paas.sdk.android.connection.RESTConnectorCache.(RESTConnectorCache.java:64) at com.shephertz.app42.paas.sdk.android.connection.RESTConnectorCache.getInstance(RESTConnectorCache.java:73) at com.shephertz.app42.paas.sdk.android.event.EventService.trackApp42Event(EventService.java:111) at com.shephertz.app42.paas.sdk.android.event.EventService.access$100(EventService.java:26) at com.shephertz.app42.paas.sdk.android.event.EventService$5.run(EventService.java:312) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.params.BasicHttpParams"

I used app 42 cloud api sdk version 4.1.2 but error still occur. In http://api.shephertz.com/tutorial/Getting-Started-Android/ I see doc have sdk version 4.1.3 but i can't get it. Thanks.

1 Answers1

0

Add the following code in Manifest.xml file under Application tag:

<uses-library
    android:name="org.apache.http.legacy"
    android:required="false" /> 

Below is the example:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="xyz.xyz.xyz">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

...
...

<application
    android:label="@string/app_name"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:theme="@style/AppTheme">

    ...
    ...

    <!-- Add this code here.. -->
    <uses-library
        android:name="org.apache.http.legacy"
        android:required="false" />

</application>
  • thanks for answer. I try your code but App 42 cloud api sdk version 4.1.2 still use org.apache.http. So app don't crash when required = false but can't find user for play online. – Tan Nguyen Aug 21 '20 at 03:27
  • I found guide of app 42. But can't find lib version 4.1.3. This is guide. If can please help me check this lib is available ?.http://api.shephertz.com/tutorial/Getting-Started-Android/ – Tan Nguyen Aug 21 '20 at 03:29
  • Version 4.1.3 is not released yet. It will be released in future. As of now kindly download and use App42 SDK Version 4.1.2 to use cloud APIs. – Harendra Singh Nayal Aug 21 '20 at 05:46