gpt4 book ai didi

java - Android 应用、Android 8(.1)、90% 华为设备中的 ANR 和崩溃

转载 作者:行者123 更新时间:2023-11-30 12:07:09 37 4
gpt4 key购买 nike

自从最近的 Android 应用程序更新以来,我遇到了 ANR 和崩溃问题,主要出现在运行 Android 8 的华为设备上。(我设法在 Honor 7x,Android 8.0 上重现了 ANR)。

  • 根据 Google Play 控制台日志,崩溃仅发生在 Android 8.1 上,93% 发生在华为设备上。
  • 另一方面,ANR(同样主要出现在华为设备上)不会出现在 Android 8.1 上(就像上面提到的崩溃),但几乎只出现在 Android 8.0 上。

这两个问题似乎是相关的 - 我猜原因是一样的,但在 Android 8.0 和 Android 8.1 上的结果不同。

关于原因:

  • 最近,应用程序中添加了一个视频广告库 ( https://www.teads.tv/ ),我认为这是导致问题的原因。
  • 如果不加载这些广告,则不会发生崩溃。

但是,我在互联网上找不到与此问题相关的任何信息。我想知道,是否真的可以对此做些什么,因为我无法访问该库,也不知道为什么这种情况几乎只发生在华为设备上。

我也在联系视频广告库的作者,但也许有人面临/已经解决了类似的问题。


Android 8.1-Crash 控制台日志

java.lang.RuntimeException: 
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.newSsl (ConscryptFileDescriptorSocket.java:161)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.<init> (ConscryptFileDescriptorSocket.java:152)
at com.android.org.conscrypt.OpenSSLSocketFactoryImpl.createSocket (OpenSSLSocketFactoryImpl.java:155)
at okhttp3.internal.connection.RealConnection.connectTls (RealConnection.java:307)
at okhttp3.internal.connection.RealConnection.establishProtocol (RealConnection.java:282)
at okhttp3.internal.connection.RealConnection.connect (RealConnection.java:167)
at okhttp3.internal.connection.StreamAllocation.findConnection (StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection (StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream (StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain (RealCall.java:200)
at okhttp3.RealCall$AsyncCall.execute (RealCall.java:147)
at okhttp3.internal.NamedRunnable.run (NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:784)
Caused by: javax.net.ssl.SSLException: 
at com.android.org.conscrypt.NativeCrypto.SSL_new (NativeCrypto.java)
at com.android.org.conscrypt.SslWrapper.newInstance (SslWrapper.java:58)
at com.android.org.c`enter code here`onscrypt.ConscryptFileDescriptorSocket.newSsl (ConscryptFileDescriptorSocket.java:159)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.<init> (ConscryptFileDescriptorSocket.java:152)
at com.android.org`enter code here`.conscrypt.OpenSSLSocketFactoryImpl.createSocket (OpenSSLSocketFactoryImpl.java:155)
at okhttp3.internal.connection.RealConnection.connectTls (RealConnection.java:307)
at okhttp3.internal.connection.RealConnection.establishProtocol (RealConnection.java:282)
at okhttp3.internal.connection.RealConnection.connect (RealConnection.java:167)
at okhttp3.internal.connection.StreamAllocation.findConnection (StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection (StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream (StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain (RealCall.java:200)
at okhttp3.RealCall$AsyncCall.execute (RealCall.java:147)
at okhttp3.internal.NamedRunnable.run (NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
at java.lang.Thread.run (Thread.java:784)

张贴 ANR 日志可能不是很有用,还是会这样?

最佳答案

看起来像a similar bug reported against OkHttp他们得出的结论是资源耗尽,导致http无法打开文件句柄。

我猜是视频广告库打开了太多文件而没有正确关闭它们,或者类似的原因。听起来解决方案是使用具有更好代码的不同广告库。

关于java - Android 应用、Android 8(.1)、90% 华为设备中的 ANR 和崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55143564/

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