我在我的应用程序中使用 Google Play 服务的 map fragment 。在自己的页面上,该 fragment 工作得很好。但是,当在另一个页面中使用时,该 fragment 用其中的 ImageView 替换了另一个 fragment (通过 Picasso 加载),应用程序和我的手机崩溃并出现一个模糊的异常:
10-24 16:07:15.097 D/REQUEST ( 7454): Connection opened to:https://clients4.google.com/glm/mmap/api
10-24 16:07:15.097 D/REQUEST ( 7454): Open Connection
10-24 16:07:15.167 W/ResourceType( 7454): CREATING STRING CACHE OF 44 bytes
10-24 16:07:15.187 D/USER_EVENTS( 7454): Event: type=78, status: MD, data: T
10-24 16:07:15.197 D/dalvikvm( 7454): GC_CONCURRENT freed 2154K, 4% free 60989K/63412K, paused 4ms+2ms, total 41ms
10-24 16:07:15.197 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 22ms
10-24 16:07:15.197 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 14ms
10-24 16:07:15.197 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 15ms
10-24 16:07:15.197 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 15ms
10-24 16:07:15.197 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 15ms
10-24 16:07:15.207 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 16ms
10-24 16:07:15.207 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 16ms
10-24 16:07:15.207 D/dalvikvm( 7454): WAIT_FOR_CONCURRENT_GC blocked 16ms
10-24 16:07:15.227 D/USER_EVENTS( 7454): Event: type=113, status: mc, data:
10-24 16:07:15.247 D/REQUEST ( 7454): Add Data Request: 147
10-24 16:07:15.287 D/USER_EVENTS( 7454): Event: type=58, status: gl, data: |r=8|g=8|b=8|a=0|d=24|s=8|v=Qualcomm|i=OpenGL ES-CM 1.1|c=Adreno (TM) 330|e=t|
10-24 16:07:15.407 E/mono-rt ( 7454):
10-24 16:07:15.407 E/mono-rt ( 7454): =================================================================
10-24 16:07:15.407 E/mono-rt ( 7454): Got a SIGSEGV while executing native code. This usually indicates
10-24 16:07:15.407 E/mono-rt ( 7454): a fatal error in the mono runtime or one of the native libraries
10-24 16:07:15.407 E/mono-rt ( 7454): used by your application.
10-24 16:07:15.407 E/mono-rt ( 7454): =================================================================
10-24 16:07:15.407 E/mono-rt ( 7454):
10-24 16:07:15.407 F/libc ( 7454): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 8262 (DataRequestDisp)
10-24 16:07:15.457 W/ ( 7454): Thread 0x80484638 may have been prematurely finalized
这恰好发生在 Google map 尝试加载数据的时候。
正如我提到的,MapFragment 替换了另一个包含 ImageView 的 Fragment,其内容是通过 Picasso 加载的。如果我删除 ImageView,则不会发生崩溃。有任何想法吗?完全难住了。
最佳答案
因此,经过大量摸索之后,我找到了导致问题的原因。
我使用的是 Xamarin Picasso 绑定(bind):https://github.com/jacksierkstra/Picasso 不幸的是,这已经有一段时间没有更新了,并且包含对旧版本 Square's ok-Http library 的引用。 .
此版本的 Ok-HTTP 似乎更改了全局 SSL 上下文,从而导致 Google 的 MapFragment 在通过 HTTPS 请求数据时中断。我在这里发现了这个问题:https://github.com/square/okhttp/issues/184 值得庆幸的是,此问题已得到修复,因此我创建了 my own Xamarin.Picasso Binding现在一切进展顺利。
这个答案帮助我开始寻找正确的方向: AbstractGoogleClient: Fatal signal 11 (SIGSEGV)
关于android - 从 Google Play 服务加载 MapFragment 时出现致命信号 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26552310/