0

I am making some updates to a legacy app that uses a dated networking library - unfortunately replacing this lib isn't possible at this point in time so I'm trying to get it working in it's current form for the time being.

The error occurs when attempting to submit post data via login form. Error:

2022-03-25 11:00:43.904 28831-28831/com.myapp.app E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.myapp.app, PID: 28831
    java.lang.VerifyError: Verifier rejected class com.loopj.android.http.AsyncHttpClient: org.apache.http.client.HttpClient com.loopj.android.http.AsyncHttpClient.getHttpClient() failed to verify: org.apache.http.client.HttpClient com.loopj.android.http.AsyncHttpClient.getHttpClient(): [0x2]  can't resolve returned type 'Unresolved Reference: org.apache.http.client.HttpClient' or 'Unresolved Reference: org.apache.http.impl.client.DefaultHttpClient' (declaration of 'com.loopj.android.http.AsyncHttpClient' appears in /data/data/com.myapp.app/code_cache/.overlay/base.apk/classes9.dex)
    at com.myapp.app.MyAppRestClient.<clinit>(MyAppRestClient.java:20)

The dependency being used in my app build.gradle is:

implementation 'com.loopj.android:android-async-http:1.4.4'

I tried to update the dependency as there's a newer version, but that broke a lot of code so I'd really like to get this 1.4.4 version working.

I also tried to add useLibrary 'org.apache.http.legacy' to my app build.gradle inside of the android{} section, but that didn't fix the problem.

  • Have you seen [this](https://stackoverflow.com/questions/38337346/cannot-resolve-defaulthttpclient-in-android-studio)? – tomerpacific Mar 25 '22 at 16:23
  • @tomerpacific yes, adding the `useLibrary` did nothing, but adding the `osgi.wrapped` dependency produces a different error than the one above: `NoClassDefFoundError`. Any ideas? Thanks! – bladerunner00 Mar 25 '22 at 16:43

0 Answers0