Development Build option triggers crash

Hello folks.

I am having a hard time figuring out how to deploy an APK to various hardware and emulated Android devices. When I build my project with “Development Build” and “Script Debugging” on, the application crashes even before reaching the Unity logo.

When both options are unchecked, on the other hand, I can test the builds without problems (but naturally I can’t debug them as I’d like). UnityRemote 5 works fine.

I targeted several API levels, with exactly the same result. The current settings are:

min API: 16
target API: highest Installed (21)
runtime version: .NET 4.6 (Experimental)
backend: Mono
stripping: disabled
logging: full
Unity Version: 2017.3.0f3

I never encountered issues in Windows builds and these settings. I’d be tempted to test the lower runtime version, but I would need hours to refactor the code to abide to the older 3.5 version.

The most recent logcat isn’t very informative:

Logcat

03-03 16:57:44.587 1497-1948/? W/installd: Ignoring /data/data/com.Studio.QuodLibet/lib with unexpected GID 0 instead of 10079
03-03 16:58:16.884 1877-1920/system_process I/PackageManager.DexOptimizer: Running dexopt (dexoptNeeded=1) on: /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/base.apk pkg=com.Studio.QuodLibet isa=x86 dexoptFlags=boot_complete,debuggable,public target-filter=quicken oatDir=/data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/oat sharedLibraries=PCL[ ]
03-03 16:58:17.424 3365-3365/? W/dex2oat: /system/bin/dex2oat --zip-fd=8 --zip-location=base.apk --input-vdex-fd=-1 --output-vdex-fd=10 --oat-fd=9 --oat-location=/data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/oat/x86/base.odex --instruction-set=x86 --instruction-set-variant=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=quicken --swap-fd=11 --debuggable --classpath-dir=/data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw== --class-loader-context=PCL[ ]
03-03 16:58:17.425 3365-3365/? I/dex2oat: /system/bin/dex2oat --input-vdex-fd=-1 --output-vdex-fd=10 --compiler-filter=quicken --debuggable --classpath-dir=/data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw== --class-loader-context=PCL[ ]
03-03 16:58:19.845 1877-1892/system_process I/ActivityManager: Force stopping com.Studio.QuodLibet appid=10079 user=-1: installPackageLI
03-03 16:58:19.961 1877-1920/system_process I/PackageManager: Package com.Studio.QuodLibet codePath changed from /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g== to /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==; Retaining data and using new
03-03 16:58:19.969 1877-1920/system_process W/PackageManager: Code path for com.Studio.QuodLibet changing from /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g== to /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==
03-03 16:58:19.969 1877-1920/system_process W/PackageManager: Resource path for com.Studio.QuodLibet changing from /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g== to /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==
03-03 16:58:20.344 2938-2938/? I/Pm: Package com.Studio.QuodLibet installed in 9096 ms
03-03 16:58:20.513 1877-1920/system_process I/ActivityManager: Force stopping com.Studio.QuodLibet appid=10079 user=0: pkg removed
03-03 16:58:21.122 2126-2126/com.android.phone D/ImsResolver: maybeAddedImsService, packageName: com.Studio.QuodLibet
03-03 16:58:28.005 1877-2968/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity} from uid 2000
03-03 16:58:28.037 1877-2968/system_process I/ActivityManager: Start proc 3854:com.Studio.QuodLibet/u0a79 for activity com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity
03-03 16:58:28.203 2036-3222/com.android.systemui W/asset: Asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk is neither a directory nor file (type=1).
03-03 16:58:28.203 2036-3222/com.android.systemui E/ResourcesManager: failed to add asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk
03-03 16:58:28.203 2036-3222/com.android.systemui W/PackageManager: Failure retrieving resources for com.Studio.QuodLibet
03-03 16:58:28.203 2036-3222/com.android.systemui W/asset: Asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk is neither a directory nor file (type=1).
03-03 16:58:28.204 2036-3222/com.android.systemui E/ResourcesManager: failed to add asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk
03-03 16:58:28.204 2036-3222/com.android.systemui W/PackageManager: Failure retrieving resources for com.Studio.QuodLibet
03-03 16:58:28.204 2036-3222/com.android.systemui W/asset: Asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk is neither a directory nor file (type=1).
03-03 16:58:28.204 2036-3222/com.android.systemui E/ResourcesManager: failed to add asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk
03-03 16:58:28.204 2036-3222/com.android.systemui W/PackageManager: Failure retrieving resources for com.Studio.QuodLibet
03-03 16:58:28.204 2036-3222/com.android.systemui W/asset: Asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk is neither a directory nor file (type=1).
03-03 16:58:28.204 2036-3222/com.android.systemui E/ResourcesManager: failed to add asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk
03-03 16:58:28.204 2036-3222/com.android.systemui W/PackageManager: Failure retrieving resources for com.Studio.QuodLibet
03-03 16:58:28.205 2036-3222/com.android.systemui W/asset: Asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk is neither a directory nor file (type=1).
03-03 16:58:28.205 2036-3222/com.android.systemui E/ResourcesManager: failed to add asset path /data/app/com.Studio.QuodLibet--RJ_K5oRHsD67ptSlgLa_g==/base.apk
03-03 16:58:28.207 2036-3222/com.android.systemui W/PackageManager: Failure retrieving resources for com.Studio.QuodLibet
03-03 16:58:28.827 1877-1912/system_process I/ActivityManager: Displayed com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity: +797ms
03-03 16:58:28.885 3854-3874/? D/Unity: [VFS] Mount /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/base.apk
03-03 16:58:29.086 3854-3874/? D/Unity: ApplicationInfo com.Studio.QuodLibet version 1.0 build 7d76a74a-f1c2-4f7e-ac34-9e6730f18930: 0 at /Users/builduser/buildslave/unity/build/PlatformDependent/AndroidPlayer/Source/EntryPoint.cpp:359 (4, 0, 0)
03-03 16:58:29.087 3854-3874/? I/Unity: ApplicationInfo com.Studio.QuodLibet version 1.0 build 7d76a74a-f1c2-4f7e-ac34-9e6730f18930
03-03 16:58:29.097 3854-3874/? D/Unity: Mono path[0] = '/data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/base.apk/assets/bin/Data/Managed'
03-03 16:58:29.098 3854-3874/? D/Unity: PlayerConnection initialized from /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/base.apk/assets/bin/Data (debug = 0)
03-03 16:58:29.098 3854-3874/? D/Unity: PlayerConnection initialized unix socket : Unity-com.Studio.QuodLibet
03-03 16:58:34.578 3854-3930/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3930 (Debugger agent), pid 3854 (tudio.QuodLibet)

[ 03-03 16:58:34.578 3854: 3929 F/ ]
Cannot transition thread 0x86eff970 from RUNNING with FINISH_ASYNC_SUSPEND
03-03 16:58:34.599 3960-3960/? A/DEBUG: pid: 3854, tid: 3930, name: Debugger agent >>> com.Studio.QuodLibet <<<
03-03 16:58:34.607 3960-3960/? A/DEBUG: #03 pc 0031d2f3 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (mono_log_write_logcat+163)
03-03 16:58:34.607 3960-3960/? A/DEBUG: #04 pc 00315d0b /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.607 3960-3960/? A/DEBUG: #05 pc 00337f6b /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (monoeg_g_logv+107)
03-03 16:58:34.607 3960-3960/? A/DEBUG: #06 pc 00337fb6 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (monoeg_g_log+56)
03-03 16:58:34.607 3960-3960/? A/DEBUG: #07 pc 0032e103 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (mono_threads_transition_finish_async_suspend+300)
03-03 16:58:34.607 3960-3960/? A/DEBUG: #08 pc 0032f117 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.608 3960-3960/? A/DEBUG: #15 pc 00160e56 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.608 3960-3960/? A/DEBUG: #16 pc 00176591 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.608 3960-3960/? A/DEBUG: #17 pc 0017674d /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.608 3960-3960/? A/DEBUG: #18 pc 0032c371 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so
03-03 16:58:34.608 3960-3960/? A/DEBUG: #19 pc 0035a231 /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (GC_inner_start_routine+92)
03-03 16:58:34.608 3960-3960/? A/DEBUG: #20 pc 0035683a /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (GC_call_with_stack_base+42)
03-03 16:58:34.608 3960-3960/? A/DEBUG: #21 pc 00359e1c /data/app/com.Studio.QuodLibet-llk60Seu8o5b22Ge1uWCjw==/lib/x86/libmonobdwgc-2.0.so (GC_start_routine+39)
03-03 16:58:35.078 1877-3965/system_process W/ActivityManager: Force finishing activity com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity
03-03 16:58:35.109 1877-1893/system_process I/ActivityManager: Showing crash dialog for package com.Studio.QuodLibet u0
03-03 16:58:35.121 1877-1981/system_process W/InputDispatcher: channel '8bd3264 com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
03-03 16:58:35.121 1877-1981/system_process E/InputDispatcher: channel '8bd3264 com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
03-03 16:58:35.142 1877-1888/system_process I/ActivityManager: Process com.Studio.QuodLibet (pid 3854) has died: vis +99TOP 
03-03 16:58:35.152 1403-1433/? E/SurfaceFlinger: Failed to find layer (SurfaceView - com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity#0) in layer parent (no-parent).
03-03 16:58:35.168 1877-1889/system_process I/WindowManager: WIN DEATH: Window{8bd3264 u0 com.Studio.QuodLibet/com.unity3d.player.UnityPlayerActivity}

The “failed to add asset path” messages precede the inevitable:

Error Message

03-03 16:58:34.578 3854-3930/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3930 (Debugger agent), pid 3854 (tudio.QuodLibet)
[ 03-03 16:58:34.578 3854: 3929 F/ ] Cannot transition thread 0x86eff970 from RUNNING with FINISH_ASYNC_SUSPEND
03-03 16:58:34.599 3960-3960/? A/DEBUG: pid: 3854, tid: 3930, name: Debugger agent >>> com.Studio.QuodLibet <<<

Does anybody have any hints as to what I might do to enable “Development Builds”. It just isn’t feasible to blindly identify bugs without references to source code lines in the long run.

Note: ticking the “Development Build” option results in a working build. The “Script Debugging” option though produces builds that crash on starting — as described above, without even getting to the logo.