【问题标题】:Retrofit - A/libc: Fatal signal 11 (SIGSEGV), code 1改造 - A/libc:致命信号 11 (SIGSEGV),代码 1
【发布时间】:2016-12-05 20:41:24
【问题描述】:

我收到 A/libc: Fatal signal 11 (SIGSEGV), code 1 时使用改造类生成我的服务接口的实现。

我相信这是由于本机库中的空指针段错误。没有抛出任何东西,所以我无法追踪它。最奇怪的部分是它不会发生在我的任何模拟器或物理设备(所有 6.0)上,除了我的 HTC 恰好是 6.0.1。

这是我的界面:

public interface RestApiPerson {
    @GET(QUERY_PERSON)
    Call<PersonSearchResults> getPersonSearchResult(@Query("query") String q);
}

这里是实现。崩溃发生在 (Call call = restApi.getPersonSearchResult(query); )

Retrofit retrofit = new Retrofit.Builder()
        .baseUrl(END_POINT_PERSON)
        .addConverterFactory(GsonConverterFactory.create())
        .build();

RestApiPerson restApi = retrofit.create(RestApiPerson.class);
Call<PersonSearchResults> call = restApi.getPersonSearchResult(query);

这是堆栈:

07-31 12:58:08.492 18310-18310/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3ad75934
07-31 12:58:08.522 18310-18310/? A/DEBUG:     r0 70fc5774  r1 12d78a00  r2 0025af14  r3 b276c070
07-31 12:58:08.522 18310-18310/? A/DEBUG:     r4 0025af14  r5 12d78a00  r6 70fc4dc4  r7 715c4a80
07-31 12:58:08.522 18310-18310/? A/DEBUG:     r8 12c5d190  r9 b8cbad20  sl 71866e80  fp be9a3a9c
07-31 12:58:08.522 18310-18310/? A/DEBUG:     ip b276c070  sp be9a3a20  lr 73d5b6e5  pc b49ffa68  cpsr 000e0030
07-31 12:58:08.522 18310-18310/? A/DEBUG: backtrace:
07-31 12:58:08.522 18310-18310/? A/DEBUG:     #00 pc 000eaa68  /system/lib/libart.so (art_quick_imt_conflict_trampoline+7)
07-31 12:58:08.522 18310-18310/? A/DEBUG:     #01 pc 022b46e3  /system/framework/arm/boot.oat (offset 0x2286000)
07-31 12:58:09.812 18310-18310/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_05

关于什么可能导致问题的任何想法,或者我如何自己确定问题?

【问题讨论】:

  • 你看过墓碑了吗?其中还有很多细节。
  • 你使用proguard吗?

标签: android retrofit retrofit2 segmentation-fault


【解决方案1】:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

我将此权限添加到 Manifest,它不再崩溃。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-21
    • 1970-01-01
    • 2022-11-21
    • 1970-01-01
    • 2021-09-10
    相关资源
    最近更新 更多