错误堆栈:

    java.lang.RuntimeException: Stub!        at org.apache.http.message.AbstractHttpMessage.(SourceFile:7)        at org.apache.http.client.methods.HttpRequestBase.(SourceFile:7)        at org.apache.http.client.methods.HttpEntityEnclosingRequestBase.(SourceFile:7)        at org.apache.http.client.methods.HttpPost.(SourceFile:8)        at com.tencent.stat.StatDispatcher.sendHttpPost(Unknown Source:104)        at com.tencent.stat.StatDispatcher$2.run(Unknown Source:6)        at android.os.Handler.handleCallback(Handler.java:873)        at android.os.Handler.dispatchMessage(Handler.java:99)        at android.os.Looper.loop(Looper.java:224)        at android.os.HandlerThread.run(HandlerThread.java:65)

原因:

在android 9.0 ,Apache HTTP client, 已经从bootClassLoader 里面移除了。

我们可以看下android 官网自己说的:
解决 Android java.lang.RuntimeException: Stub!_第1张图片

解决方法:

在清单里面,加上下面这句:

加的位置是在application节点里面,如下图:
解决 Android java.lang.RuntimeException: Stub!_第2张图片

注意:

这个只会对target 升级到android 9.0 及以上的应用,才会报这个错误。如果没有升级target,那么不会报错。java.lang.RuntimeException: Stub!

参考:

https://developer.android.com/about/versions/pie/android-9.0-changes-28

更多相关文章

  1. Android AApt错误
  2. Android Studio之RenderingException错误
  3. Android SDK 26以后ant编译错误解决办法(错误信息:taskdef A class
  4. Android的低级错误
  5. android:报Activity has leaked IntentReceiver或者receiver is
  6. android 错误
  7. Android emulator模拟器启动错误
  8. Android命令行启动程序-am命令的使用-纠正网上大部分资料的错误
  9. 在android 中导入项目后 包出现错误

随机推荐

  1. Error inflating class android.support.
  2. android volley https
  3. Android获取程序路径 (/data/data/appname
  4. Ubuntu 14.04烧Nexus 5手机
  5. android,view的执行过程onDraw、onSizeCha
  6. 修改文件夹权限
  7. Android获取apk的版本及包名等信息
  8. Android处理POST请求、Android用SAX解析X
  9. mac 下启动Android(安卓)Studio 时出现 A
  10. Android(安卓)计算器编程实现