解决 Android java.lang.RuntimeException: Stub!
16lz
2021-01-23
错误堆栈:
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 官网自己说的:
解决方法:
在清单里面,加上下面这句:
加的位置是在application节点里面,如下图:
注意:
这个只会对target 升级到android 9.0 及以上的应用,才会报这个错误。如果没有升级target,那么不会报错。java.lang.RuntimeException: Stub!
参考:
https://developer.android.com/about/versions/pie/android-9.0-changes-28
更多相关文章
- Android AApt错误
- Android Studio之RenderingException错误
- Android SDK 26以后ant编译错误解决办法(错误信息:taskdef A class
- Android的低级错误
- android:报Activity has leaked IntentReceiver或者receiver is
- android 错误
- Android emulator模拟器启动错误
- Android命令行启动程序-am命令的使用-纠正网上大部分资料的错误
- 在android 中导入项目后 包出现错误