0

Volley library is used in the Android app we are developing.However, the following error has occurred in Android9.

java.lang.NoClassDefFoundError: 
at com.android.volley.toolbox.HurlStack.performRequest (HurlStack.java:108)
at com.android.volley.toolbox.BasicNetwork.performRequest (BasicNetwork.java:96)
at com.android.volley.NetworkDispatcher.run (NetworkDispatcher.java:112)

Since Apache HTTP Legacy library is not available on Android9, the following code is inserted in AndroidManifest.xml, but the error is not resolved.

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

Could you tell me how to solve this problem?

supermonkey
  • 631
  • 11
  • 25

1 Answers1

0

With Android 6.0, we removed support for the Apache HTTP client. This change has no effect on the great majority of apps that do not target Android 9 or higher. However, the change can affect certain apps that use a nonstandard ClassLoader structure, even if the apps do not target Android 9 or higher.

Reference: https://developer.android.com/about/versions/pie/android-9.0-changes-all#apache-nonp

Alternatively try changing your buildToolsVersion to '28.0.2' and compileSdkVersion to 27 and try again.

Vinay Jayaram
  • 1,030
  • 9
  • 29