gpt4 book ai didi

android - 从崩溃报告服务获取 "androidApplicationContext must be not null!"崩溃

转载 作者:行者123 更新时间:2023-11-30 03:29:30 25 4
gpt4 key购买 nike

在支持 linkedin 社交网络后,我正在开发的一个应用程序导致了很多崩溃,其中唯一写的是“androidApplicationContext 必须不为空!” .

我在网上搜索了一下,只找到了下一个链接作为线索:

Aug 28 17:15:23 <S3nsat10n> has anyone run across a stacktrace like this? http://pastebin.com/QeV9D8XH
Aug 28 17:15:33 <S3nsat10n> has to do with a null app context inside the apache httpclient
Aug 28 17:15:38 <Hodapp> wongk: yeah, I'm just really confused about why it's doing this...
Aug 28 17:15:47 <S3nsat10n> highly modified httpclient it would seem, judging my the naf.gba package stuff
Aug 28 17:15:51 <S3nsat10n> Seems to be happening only on Samsung Galaxy S devices, but I don't know if that's always the case.
Aug 28 17:16:48 <wongk> S3nsat10n: never see that
Aug 28 17:16:50 <wongk> seen
Aug 28 17:17:17 <S3nsat10n> yeah :/
Aug 28 17:17:22 <S3nsat10n> neither has most of the internet...
Aug 28 17:17:23 <S3nsat10n> heh

还有其他人遇到过这种奇怪且极其罕见的错误吗?

如果是这样,您是如何解决的?

最佳答案

两种解决方案:

  • 使用 HttpURLConnection 而不是 HttpClient
  • 尽快在应用程序的主线程中创建一个 HttpClient 实例,例如在其 onCreate 方法中。

更多详情 here .

关于android - 从崩溃报告服务获取 "androidApplicationContext must be not null!"崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17703258/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com