How to use apache http on Android P
up vote
4
down vote
favorite
When I run my app in Android P devices, I get some error like this:
java.lang.RuntimeException: Unable to instantiate application com.le.android.client.LeApplication: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1009)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5836)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1120)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1001)
... 9 more
How should I use the library org.apache.http.legacy
in Android P?
java android apache-httpcomponents
add a comment |
up vote
4
down vote
favorite
When I run my app in Android P devices, I get some error like this:
java.lang.RuntimeException: Unable to instantiate application com.le.android.client.LeApplication: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1009)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5836)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1120)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1001)
... 9 more
How should I use the library org.apache.http.legacy
in Android P?
java android apache-httpcomponents
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
When I run my app in Android P devices, I get some error like this:
java.lang.RuntimeException: Unable to instantiate application com.le.android.client.LeApplication: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1009)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5836)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1120)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1001)
... 9 more
How should I use the library org.apache.http.legacy
in Android P?
java android apache-httpcomponents
When I run my app in Android P devices, I get some error like this:
java.lang.RuntimeException: Unable to instantiate application com.le.android.client.LeApplication: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1009)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5836)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1637)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6649)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.le.android.client.LeApplication" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk"],nativeLibraryDirectories=[/data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/lib/arm, /data/app/com.le.android.client-uvQkO641-__8Z_p2oT0t7g==/base.apk!/lib/armeabi, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1120)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1001)
... 9 more
How should I use the library org.apache.http.legacy
in Android P?
java android apache-httpcomponents
java android apache-httpcomponents
edited May 21 at 10:24
Jörg Beyer
2,7691330
2,7691330
asked May 21 at 9:50
Scott
797
797
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
I read the Android P behavior changes,and I get some messages:
Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client.
Beginning with Android P, that library is removed from the
bootclasspath and is not available to apps by default.
To continue using the Apache HTTP client,
apps that target Android P and above must add the following to their AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Note: The android:required="false" attribute is required for apps that mave a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
I read the Android P behavior changes,and I get some messages:
Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client.
Beginning with Android P, that library is removed from the
bootclasspath and is not available to apps by default.
To continue using the Apache HTTP client,
apps that target Android P and above must add the following to their AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Note: The android:required="false" attribute is required for apps that mave a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
add a comment |
up vote
6
down vote
I read the Android P behavior changes,and I get some messages:
Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client.
Beginning with Android P, that library is removed from the
bootclasspath and is not available to apps by default.
To continue using the Apache HTTP client,
apps that target Android P and above must add the following to their AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Note: The android:required="false" attribute is required for apps that mave a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
add a comment |
up vote
6
down vote
up vote
6
down vote
I read the Android P behavior changes,and I get some messages:
Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client.
Beginning with Android P, that library is removed from the
bootclasspath and is not available to apps by default.
To continue using the Apache HTTP client,
apps that target Android P and above must add the following to their AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Note: The android:required="false" attribute is required for apps that mave a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
I read the Android P behavior changes,and I get some messages:
Apache HTTP client deprecation
With Android 6.0, we removed support for the Apache HTTP client.
Beginning with Android P, that library is removed from the
bootclasspath and is not available to apps by default.
To continue using the Apache HTTP client,
apps that target Android P and above must add the following to their AndroidManifest.xml:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Note: The android:required="false" attribute is required for apps that mave a minimum SDK of 23 or lower, because on devices with API levels lower than 24, the org.apache.http.legacy library is not available. (On those devices, the Apache HTTP classes are available on the bootclasspath.)
edited Sep 5 at 5:08
Maitreya
626813
626813
answered May 22 at 2:22
Scott
797
797
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
add a comment |
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
1
1
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
Even after adding this...my app still crash with the same error @scott
– divaPrajapati09
Nov 13 at 13:28
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50446148%2fhow-to-use-apache-http-on-android-p%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown