How to use apache http on Android P
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 |
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 |
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,7791330
2,7791330
asked May 21 at 9:50
Scott
897
897
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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 have 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 |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 have 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 |
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 have 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 |
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 have 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 have 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 2 days ago
MatPag
12.2k73651
12.2k73651
answered May 22 at 2:22
Scott
897
897
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