1

We used official guideline to implement text translation feature with ML Kit on Android. Current version of the library is 'com.google.mlkit:translate:16.1.2'. It works as expected in the debug build but it crashes in the release build with the crash from native code:

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78f4752a0a in tid 5897

If we mark release build as debuggable, crash does not occur.

Any ideas what could go wrong?

Additional files requested in comments:

stacktrace:

    --------- beginning of crash
2021-08-18 14:09:40.411 5897-5897 A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78f4752a0a in tid 5897 (homegate.mobile), pid 5897 (homegate.mobile)
2021-08-18 14:09:40.556 6304-6304 I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-08-18 14:09:40.556 979-979 I/tombstoned: received crash request for pid 5897
2021-08-18 14:09:40.564 6304-6304 I/crash_dump64: performing dump of process 5897 (target tid = 5897)
2021-08-18 14:09:40.570 5897-6189 I/Counters: exceeded sample count in FrameTime
2021-08-18 14:09:40.575 6304-6304 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-08-18 14:09:40.576 6304-6304 Build fingerprint: 'google/sargo/sargo:11/RQ3A.210805.001.A1/7474174:user/release-keys'
2021-08-18 14:09:40.576 6304-6304 Revision: 'MP1.0'
2021-08-18 14:09:40.576 6304-6304 ABI: 'arm64'
2021-08-18 14:09:40.576 6304-6304 Timestamp: 2021-08-18 14:09:40+0200
2021-08-18 14:09:40.576 6304-6304 pid: 5897, tid: 5897, name: homegate.mobile  >>> ch.homegate.mobile <<<
2021-08-18 14:09:40.576 6304-6304 uid: 10072
2021-08-18 14:09:40.576 6304-6304 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78f4752a0a
2021-08-18 14:09:40.576 6304-6304     x0  0000000000000000  x1  00000000000008fc  x2  000000788245bc71  x3  0000000000000000
2021-08-18 14:09:40.576 6304-6304     x4  0000000000000010  x5  00000079e5cf2df0  x6  0000007945c71120  x7  3cea0ea100000634
2021-08-18 14:09:40.576 6304-6304     x8  00000079c5c93070  x9  00000078f4755c6d  x10 0000000000000000  x11 00000078f47520c8
2021-08-18 14:09:40.576 6304-6304     x12 0000000000000009  x13 0000000000000000  x14 0000000000000061  x15 000000000000000c
2021-08-18 14:09:40.576 6304-6304     x16 00000078824caef8  x17 0000007b9607ead4  x18 0000007b9b5f4000  x19 0000007fe00de598
2021-08-18 14:09:40.576 6304-6304     x20 0000000000000000  x21 00000079b5cb3f70  x22 00000079c5c93070  x23 00000079b5cb3f78
2021-08-18 14:09:40.576 6304-6304     x24 0000000000000009  x25 00000000000004a1  x26 0000000000000012  x27 000000000000005f
2021-08-18 14:09:40.576 6304-6304     x28 0000007975d22ee0  x29 0000000000000000
2021-08-18 14:09:40.576 6304-6304     lr  0000007882485964  sp  0000007fe00de3a0  pc  00000078824867c0  pst 0000000060000000
2021-08-18 14:09:40.581 5897-6189 I/Counters: exceeded sample count in FrameTime
2021-08-18 14:09:40.761 1022-1239 D/VSC: @ 92931.790: [WO] isFlat() nearest_rotation: 0, flat_angle: 65
2021-08-18 14:09:40.762 1022-1239 D/VSC: @ 92931.790: [WO] orientation angle 17, orientation 0
2021-08-18 14:09:40.762 1022-1239 D/VSC: @ 92931.790: [WO] rejected by isOrientationAngleAcceptable
2021-08-18 14:09:40.861 6304-6304 backtrace:
2021-08-18 14:09:40.861 6304-6304       #00 pc 000000000003c7c0  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #01 pc 000000000003b960  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #02 pc 000000000003bb48  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #03 pc 000000000003bafc  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #04 pc 0000000000036c98  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #05 pc 00000000000324a4  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #06 pc 0000000000031b5c  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/lib/arm64/liblanguage_id_jni.so (Java_com_google_mlkit_nl_languageid_internal_LanguageIdentificationJni_nativeIdentifyLanguage+100) (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
2021-08-18 14:09:40.861 6304-6304       #07 pc 000000000007a6a8  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.odex (art_jni_trampoline+168)
2021-08-18 14:09:40.861 6304-6304       #08 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #09 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #10 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #11 pc 000000000030e648  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #12 pc 0000000000682f88  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtualQuick+672) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #13 pc 0000000000131594  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual_quick+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #14 pc 0000000000e077fc  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (qk.d.call+124)
2021-08-18 14:09:40.861 6304-6304       #15 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #16 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #17 pc 0000000000ae1432  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (com.google.android.gms.internal.ads.f20.run+1686)
2021-08-18 14:09:40.861 6304-6304       #18 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #19 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #20 pc 0000000000e00892  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (qh.q.run+794)
2021-08-18 14:09:40.861 6304-6304       #21 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #22 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #23 pc 0000000000e0d854  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (rk.a.execute+52)
2021-08-18 14:09:40.861 6304-6304       #24 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #25 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #26 pc 0000000000de4294  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (ok.o.execute+16)
2021-08-18 14:09:40.861 6304-6304       #27 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #28 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #29 pc 0000000000de4034  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (ok.k.a+56)
2021-08-18 14:09:40.861 6304-6304       #30 pc 0000000000683228  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtualQuick+1344) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #31 pc 0000000000131594  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual_quick+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #32 pc 0000000000cecc44  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (com.google.mlkit.common.sdkinternal.a.a+124)
2021-08-18 14:09:40.861 6304-6304       #33 pc 0000000000683228  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtualQuick+1344) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #34 pc 0000000000131594  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual_quick+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #35 pc 000000000039286a  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (ch.homegate.mobile.main.usecase.MlKitTranslationUseCaseImpl.a+482)
2021-08-18 14:09:40.861 6304-6304       #36 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #37 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #38 pc 000000000036c462  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (ch.homegate.mobile.main.detail.DetailViewModel.d+2602)
2021-08-18 14:09:40.861 6304-6304       #39 pc 000000000067f740  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #40 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #41 pc 000000000036a0ae  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (ch.homegate.mobile.main.detail.DetailViewModel$loadDetail$1$invokeSuspend$$inlined$collect$1.emit+774)
2021-08-18 14:09:40.861 6304-6304       #42 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #43 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #44 pc 0000000001339b64  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (kotlinx.coroutines.flow.FlowKt__ErrorsKt$catchImpl$$inlined$collect$1.emit+128)
2021-08-18 14:09:40.861 6304-6304       #45 pc 000000000067e21c  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #46 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #47 pc 0000000001337d90  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (kotlinx.coroutines.flow.FlowKt__ChannelsKt.a+284)
2021-08-18 14:09:40.861 6304-6304       #48 pc 000000000067f740  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #49 pc 000000000012d994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #50 pc 0000000001337c42  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend+22)
2021-08-18 14:09:40.861 6304-6304       #51 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+268) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.861 6304-6304       #52 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #53 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #54 pc 00000000021b00d4  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith+276)
2021-08-18 14:09:40.862 6304-6304       #55 pc 0000000000133564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #56 pc 00000000001a8a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #57 pc 000000000031831c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #58 pc 000000000030e648  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #59 pc 000000000067df14  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1032) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #60 pc 000000000012da14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #61 pc 00000000013a739c  /data/app/~~agM6IoX_2TvQjEyG25sAfQ==/ch.homegate.mobile-VNjMAk_4GEv45vV5JSrgmw==/oat/arm64/base.vdex (sl.p0.run+244)
2021-08-18 14:09:40.862 6304-6304       #62 pc 0000000000305c44  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.6432830707213048161)+268) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #63 pc 000000000066b24c  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #64 pc 000000000013cff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #65 pc 0000000000634c8c  /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+76) (BuildId: c796a34e8ce906ec2c393327c9700abd6e60ca15)
2021-08-18 14:09:40.862 6304-6304       #66 pc 00000000006381ec  /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+1516) (BuildId: c796a34e8ce906ec2c393327c9700abd6e60ca15)
2021-08-18 14:09:40.862 6304-6304       #67 pc 00000000003fbaa0  /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+752) (BuildId: c796a34e8ce906ec2c393327c9700abd6e60ca15)
2021-08-18 14:09:40.862 6304-6304       #68 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #69 pc 00000000001a8a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #70 pc 0000000000555748  /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1364) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #71 pc 00000000004d4ef0  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #72 pc 00000000000896f4  /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: ceb5e62f6d91c45ea99526daec5879eba39c6a54)
2021-08-18 14:09:40.862 6304-6304       #73 pc 000000000088bfd8  /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136) (BuildId: c796a34e8ce906ec2c393327c9700abd6e60ca15)
2021-08-18 14:09:40.862 6304-6304       #74 pc 0000000000894708  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2280) (BuildId: c796a34e8ce906ec2c393327c9700abd6e60ca15)
2021-08-18 14:09:40.862 6304-6304       #75 pc 00000000001337e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #76 pc 00000000001a8a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #77 pc 0000000000554184  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #78 pc 0000000000554638  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #79 pc 0000000000438b08  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+656) (BuildId: 0183cc6150704cdc371a87b659800e56)
2021-08-18 14:09:40.862 6304-6304       #80 pc 0000000000099424  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+124) (BuildId: 1dec5134a09522f9c83c48dae0aec3be)
2021-08-18 14:09:40.862 6304-6304       #81 pc 00000000000a08b0  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+836) (BuildId: 1dec5134a09522f9c83c48dae0aec3be)
2021-08-18 14:09:40.862 6304-6304       #82 pc 0000000000003580  /system/bin/app_process64 (main+1336) (BuildId: 8b041fc279d5108900e48324bafa5142)
2021-08-18 14:09:40.862 6304-6304       #83 pc 000000000004988c  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: 49090ae59e6ae37f8beae53c551820ad)
2021-08-18 14:09:40.869 3080-3104 D/DeviceStateHelper: Audo mode: 0
2021-08-18 14:09:41.170 1639-6307 W/ActivityTaskManager:   Force finishing activity ch.homegate.mobile/.main.MainActivity

build.gradle

buildscript {
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-allopen:$Versions.kotlin"
    }
}

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'kotlin-parcelize'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "kotlin-allopen"

android {
    compileSdkVersion rootProject.compileSdk

    defaultConfig {
        applicationId "ch.homegate.mobile"
        minSdkVersion rootProject.minSdk
        targetSdkVersion rootProject.targetSdk
        versionCode rootProject.versionCode
        versionName rootProject.versionName

        vectorDrawables.useSupportLibrary = true

        resConfigs "de", "en", "it", "fr"

        lintOptions {
            checkReleaseBuilds false
        }

        testInstrumentationRunnerArguments clearPackageData: 'true'
    }

    testOptions {
        execution "ANDROIDX_TEST_ORCHESTRATOR"
        unitTests {
            returnDefaultValues true
            includeAndroidResources true
            all {
                jvmArgs '-noverify'
                reports {
                    junitXml.enabled = true
                    html.enabled = true
                }
            }
        }
    }

    buildFeatures {
        viewBinding true
    }

    compileOptions {
        sourceCompatibility JAVA_VERSION
        targetCompatibility JAVA_VERSION
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }

    lintOptions {
        abortOnError false
        warning 'RestrictedApi'
    }

    buildTypes {
        release {
            signingConfig releaseSigningConfig
            minifyEnabled true
            zipAlignEnabled true
        }
        debug {
            ext.enableCrashlytics = false
            ext.alwaysUpdateBuildId = false
            debuggable true
            minifyEnabled false
        }
    }

    bundle {
        language {
            // Specifies that the app bundle should not support
            // configuration APKs for language resources. These
            // resources are instead packaged with each base and
            // dynamic feature APK.
            enableSplit = false
        }
        density {
            // This property is set to true by default.
            enableSplit = true
        }
        abi {
            // This property is set to true by default.
            enableSplit = true
        }
    }

    packagingOptions {
        // added this line to be able to create release apk from android studio
        exclude 'classes.dex'
        pickFirst("META-INF/atomicfu.kotlin_module")
        pickFirst("META-INF/ui_release.kotlin_module")
    }
}

dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Dependencies.kotlinx}"
    implementation "org.jetbrains.kotlin:kotlin-reflect:${Dependencies.kotlin}"
    debugImplementation "com.squareup.okhttp3:logging-interceptor:${Dependencies.okhttp}"

    implementation "pub.devrel:easypermissions:${Dependencies.easypermissions}"

    implementation platform("com.google.firebase:firebase-bom:${Dependencies.firebaseBoM}")
    implementation "com.google.firebase:firebase-config"
    implementation "com.google.firebase:firebase-perf-ktx"
    implementation "com.google.android.gms:play-services-location:${Dependencies.googlePlayServicesLocation}"

    implementation "com.google.android.gms:play-services-auth:${Dependencies.googlePlayServicesAuth}"
    implementation "com.google.android.gms:play-services-maps:${Dependencies.googlePlayServicesMaps}"
    implementation "com.google.maps.android:android-maps-utils:${Dependencies.mapsUtils}"

    implementation "com.google.android.material:material:${Dependencies.material}"
    implementation "androidx.constraintlayout:constraintlayout:${Dependencies.constraintLayout}"
    implementation "androidx.recyclerview:recyclerview:${Dependencies.recyclerView}"
    implementation "androidx.cardview:cardview:${Dependencies.cardView}"
    implementation "androidx.recyclerview:recyclerview-selection:${Dependencies.recyclerViewSelection}"
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:${Dependencies.swipeToRefresh}"
    implementation "androidx.dynamicanimation:dynamicanimation:${Dependencies.animations}"

    implementation "androidx.work:work-runtime-ktx:${Dependencies.workManager}"
    androidTestImplementation "androidx.work:work-testing:${Dependencies.workManager}"

    implementation "androidx.core:core-ktx:${Dependencies.coreKtx}"
    implementation "androidx.activity:activity-ktx:${Dependencies.activityKtx}"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:${Dependencies.livedata}"
    implementation("androidx.lifecycle:lifecycle-extensions:${Dependencies.lifecycle}") {
        exclude group: 'com.google.code.gson'
    }

    kapt "androidx.lifecycle:lifecycle-common-java8:${Dependencies.lifecycle}"

    implementation "androidx.paging:paging-runtime:${Dependencies.pagingVersion}"

    implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${Dependencies.jacksonVersion}"
    implementation "com.fasterxml.jackson.core:jackson-databind:${Dependencies.jacksonVersion}"
    implementation "com.fasterxml.jackson.core:jackson-annotations:${Dependencies.jacksonVersion}"
    implementation "com.fasterxml.jackson.core:jackson-core:${Dependencies.jacksonVersion}"
    implementation "com.squareup.retrofit2:converter-jackson:${Dependencies.retrofitJacksonVersion}"

    implementation "com.google.android.flexbox:flexbox:${Dependencies.flexboxVersion}"

    implementation "androidx.preference:preference-ktx:${Dependencies.preferenceManager}"

    implementation("com.google.firebase:firebase-crashlytics") {
        transitive = true
    }

    implementation "com.github.PGrube26:RangeSeekBar:${Dependencies.rangeBar}"
    implementation "com.facebook.shimmer:shimmer:${Dependencies.facebookShimmer}"
    implementation "com.jakewharton.threetenabp:threetenabp:${Dependencies.threetenabp}"

    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${Dependencies.viewModelScope}"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:${Dependencies.lifecycleScope}"

    implementation "com.github.bumptech.glide:glide:${Dependencies.glide}"
    implementation "com.jakewharton.timber:timber:${Dependencies.timberVersion}"

    implementation "org.locationtech.jts:jts-core:${Dependencies.jts}"

    implementation "com.github.chrisbanes:PhotoView:${Dependencies.photoView}"

    implementation "uk.co.samuelwall:material-tap-target-prompt:${Dependencies.materialTapTargetPrompt}"
    implementation "androidx.test.espresso:espresso-idling-resource:${Dependencies.espressoVersion}"

    implementation "com.google.mlkit:language-id:${Dependencies.mlLanguage}"
    implementation "com.google.mlkit:translate:${Dependencies.mlTranslate}"

    implementation "com.android.installreferrer:installreferrer:${Dependencies.installReferrer}"
    implementation "com.comscore:android-analytics:${Dependencies.comscore}"

    implementation "com.google.android.gms:play-services-ads:${Dependencies.ads}"
    implementation "com.android.support:support-annotations:${Dependencies.supportAnnotation}"

    implementation "com.yarolegovich:discrete-scrollview:${Dependencies.discreteScrollView}"

    implementation("com.appelium:feedback:2.1.1:release@aar") {
        transitive = true
    }
}

And regarding the device info, it was tested on the Pixel 3a (Android version 11)

  • This is not reproducible. Please provide the full stack-track; likely you are missing rules for R8. – Martin Zeitler Aug 18 '21 at 23:58
  • thanks for your report. Could you provide more information for us to debug? 1. Your build.gradle so we can know how you build the app 2. Full stacktrace about the error 3. Device Info and api level, also does it only happen on one device? Thanks – jack Aug 19 '21 at 03:35
  • Hey @jack and @martin-zeitler thank you for your comments. I added stacktrace, build.gradle and device info and OS version. This happens on multiple devices. I also suspect that we are missing rules for R8 but I am not sure which ones since there is nothing mentioned in the official docs. Any ideas how we can investigate this? We managed to create workaround for this crash by avoiding removing unused code inside of the `postprocessing` block. – Stevan Milovanovic Aug 20 '21 at 14:00
  • Hi Stevan, It seems like a crash inside `language id` SDK. What's the version of `language id` are you using? Also could you explain more about `avoid removing unused code`? Maybe paste out what that code is? Thanks – jack Aug 20 '21 at 16:22
  • Also for language id we released a new version `17.0.0`, could you try that? https://maven.google.com/web/index.html?q=mlkit#com.google.mlkit:language-id – jack Aug 20 '21 at 16:38
  • Also what is your targetSDK level and compileSDK level? – jack Aug 20 '21 at 17:49
  • Hi Jack, thank you for your answers. Currently we are using version 16.1.1 of language id and 16.1.2 for translate SDK. Our targetSDK and compileSDKs are 30. And regarding the workaroung we are now using this block instead of `minifyEnabled true` statement: ` postprocessing {` ` removeUnusedCode false` ` obfuscate true` ` optimizeCode true` ` proguardFiles 'proguard-rules.pro'` ` }` – Stevan Milovanovic Aug 23 '21 at 09:06
  • Sorry, there seems to be some formatting issue with multiline code block. More on this topic I found [here](https://stackoverflow.com/questions/47510109/what-is-postprocessing-block-inside-the-release-block-in-app-level-gradle-fi) – Stevan Milovanovic Aug 23 '21 at 09:16
  • We tried the latest language-id SDK version, the app is not crashing anymore but we are not getting the right language id or we are not getting the response at all. [Here is the video of the testing session](https://wetransfer.com/downloads/78e9564a50a275e6cbc423167419f91820210823095102/c6e825) – Stevan Milovanovic Aug 23 '21 at 09:57
  • For the issue in new SDK, could you provide a bugreport and share it here? Thanks! – jack Aug 24 '21 at 20:49

4 Answers4

3

17.0.0 is crashed too

Workaround: Replace standalone version of the kit with dynamic model from Google Play Services. I.e. replace 'com.google.mlkit:language-id:17.0.0' with 'com.google.android.gms:play-services-mlkit-language-id:16.0.0-beta1' in Gradle dependencies.

More info: https://developers.google.com/ml-kit/language/identification/android

Sergey Krivenkov
  • 579
  • 1
  • 6
  • 14
1

Google posted workaround for this issue.

For temporary workarounds for the existing SDKs, you need to add this rule

  • For language-id 16.1.1
-keep class com.google.mlkit.nl.languageid.internal.LanguageIdentificationJni { *; }
  • For language-id 17.0.0+
-keep class com.google.mlkit.nl.languageid.internal.ThickLanguageIdentifier { *; }
ganachoco
  • 302
  • 1
  • 3
0

Was it the same crash error by 17.0.0? Could you share the error log with me to take a look?

Glad to see that 'com.google.android.gms:play-services-mlkit-language-id:16.0.0-beta1' works and it will save APK size by downloading model from Google Play Services.

yliu
  • 51
  • 2
0

It seems this is R8 optimizer issue.

I posted on R8 issue tracker for this.

https://issuetracker.google.com/issues/203573699

ganachoco
  • 302
  • 1
  • 3