Skip to content

APKS with ABI split crash on start up #785

@petekanev

Description

@petekanev

This is a:

  • Bug report
  • Feature request

Is this a real problem/a really cool feature?

  • I checked and verified that the Feature/Issue is not already logged on SO
  • I checked and verified that the Feature/Issue is not already logged on Github issues

Context:

Application packages built with ABI split configuration crash when started on device. The reason for that is buildMetadata gradle task executes after the built-in package and assemble tasks.

Your environment (if applicable):

  • CLI: 3.0.
  • Runtime version: 3.0.0 - 3.0.1
  • Cross-platform modules: 3.0.1
  • Plugin(s):
  • OS: Any
  • Node and npm: Any
  • Device/Emulator: x86 Geny Emulator, armeabi-v7a Nexus 5 device
  • Android API Level: Any

Type of error (if applicable):

  • Build-time
  • Run-time

Error logs (if applicable):

01-11 08:58:12.879 19049-19049/? I/TNS.Native: NativeScript Runtime Version 3.0.0, commit ce5d00f3a0f361ccef99f42c40bdc7a1955c298c
01-11 08:58:12.879 19049-19049/? D/TNS.Native: JNI_ONLoad
01-11 08:58:12.879 19049-19049/? D/TNS.Native: JNI_ONLoad END
01-11 08:58:14.567 19049-19049/? D/TNS.Native: Failed to load snapshot: dlopen failed: library "libsnapshot.so" not found
01-11 08:58:14.664 19049-19049/? D/TNS.Native: V8 version 5.5.372.32
01-11 08:58:14.751 19049-19049/? A/libc: /usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type tns::NativeScriptException" failed
01-11 08:58:14.751 19049-19049/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 19049 (ativescript.ar1)
01-11 08:58:14.852 180-180/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-11 08:58:14.852 180-180/? I/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:5.0/LRX21O/1570415:user/release-keys'
01-11 08:58:14.852 180-180/? I/DEBUG: Revision: '11'
01-11 08:58:14.852 180-180/? I/DEBUG: ABI: 'arm'
01-11 08:58:14.852 180-180/? I/DEBUG: pid: 19049, tid: 19049, name: ativescript.ar1  >>> org.nativescript.ar1 <<<
01-11 08:58:14.852 180-180/? I/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-11 08:58:14.870 180-180/? I/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-r12-release/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type tns::NativeScriptException" failed'
01-11 08:58:14.870 180-180/? I/DEBUG:     r0 00000000  r1 00004a69  r2 00000006  r3 00000000
01-11 08:58:14.870 180-180/? I/DEBUG:     r4 b6f66114  r5 00000006  r6 00000002  r7 0000010c
01-11 08:58:14.870 180-180/? I/DEBUG:     r8 a32afa21  r9 beb4ec68  sl 12c08e40  fp 00000000
01-11 08:58:14.870 180-180/? I/DEBUG:     ip 00004a69  sp beb4e748  lr b6ef0af9  pc b6f145d4  cpsr 600d0010
01-11 08:58:14.870 180-180/? I/DEBUG: backtrace:
01-11 08:58:14.870 180-180/? I/DEBUG:     #00 pc 0003a5d4  /system/lib/libc.so (tgkill+12)
01-11 08:58:14.870 180-180/? I/DEBUG:     #01 pc 00016af5  /system/lib/libc.so (pthread_kill+52)
01-11 08:58:14.870 180-180/? I/DEBUG:     #02 pc 00017707  /system/lib/libc.so (raise+10)
01-11 08:58:14.870 180-180/? I/DEBUG:     #03 pc 00013f75  /system/lib/libc.so (__libc_android_abort+36)
01-11 08:58:14.870 180-180/? I/DEBUG:     #04 pc 00012a3c  /system/lib/libc.so (abort+4)
01-11 08:58:14.870 180-180/? I/DEBUG:     #05 pc 00015225  /system/lib/libc.so (__libc_fatal+16)
01-11 08:58:14.870 180-180/? I/DEBUG:     #06 pc 00013ff9  /system/lib/libc.so (__assert2+20)
01-11 08:58:14.870 180-180/? I/DEBUG:     #07 pc 0010afd5  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #08 pc 0010b0b7  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #09 pc 001099e9  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #10 pc 00109555  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #11 pc 00076041  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #12 pc 00072eb9  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so
01-11 08:58:14.870 180-180/? I/DEBUG:     #13 pc 000d1711  /data/app/org.nativescript.ar1-1/lib/arm/libNativeScript.so (Java_com_tns_Runtime_initNativeScript+52)
01-11 08:58:14.870 180-180/? I/DEBUG:     #14 pc 00153d77  /data/dalvik-cache/arm/data@app@org.nativescript.ar1-1@base.apk@classes.dex
01-11 08:58:15.215 180-180/? I/DEBUG: Tombstone written to: /data/tombstones/tombstone_04
01-11 08:58:15.216 773-838/? I/BootReceiver: Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE)
01-11 08:58:15.216 773-1830/? E/SharedPreferencesImpl: Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
01-11 08:58:15.238 245-245/? I/Zygote: Process 19049 exited due to signal (6)
01-11 08:58:15.247 773-2260/? I/ActivityManager: Process org.nativescript.ar1 (pid 19049) has died

Build log illustrating the order of tasks executed:

:preBuild UP-TO-DATE
:preF0DebugBuild UP-TO-DATE
:checkF0DebugManifest
:preF0ReleaseBuild UP-TO-DATE
:prepareAr1RuntimeUnspecifiedLibrary
:prepareComAndroidSupportAnimatedVectorDrawable2531Library
:prepareComAndroidSupportAppcompatV72531Library
:prepareComAndroidSupportDesign2531Library
:prepareComAndroidSupportRecyclerviewV72531Library
:prepareComAndroidSupportSupportCompat2531Library
:prepareComAndroidSupportSupportCoreUi2531Library
:prepareComAndroidSupportSupportCoreUtils2531Library
:prepareComAndroidSupportSupportFragment2531Library
:prepareComAndroidSupportSupportMediaCompat2531Library
:prepareComAndroidSupportSupportV42531Library
:prepareComAndroidSupportSupportVectorDrawable2531Library
:prepareComAndroidSupportTransition2531Library
:prepareWidgetsReleaseLibrary
:prepareF0DebugDependencies
:compileF0DebugAidl
:compileF0DebugRenderscript
:generateF0DebugBuildConfig
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser
Running full build
finished with reading lines with js files
:asbg:generateBindings
:generateF0DebugResValues
:generateF0DebugResources
:mergeF0DebugResources
:processF0Arm64-v8aDebugManifest
:processF0Arm64-v8aDebugResources
:processF0Armeabi-v7aDebugManifest
:processF0Armeabi-v7aDebugResources
:processF0X86DebugManifest
:processF0X86DebugResources
:generateF0DebugSources
:incrementalF0DebugJavaCompilationSafeguard
:compileF0DebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:mergeF0DebugShaders
:compileF0DebugShaders
:generateF0DebugAssets
:mergeF0DebugAssets
:transformClassesWithDexForF0Debug
:compileF0DebugNdk UP-TO-DATE
:mergeF0DebugJniLibFolders
:transformNative_libsWithMergeJniLibsForF0Debug
:transformNative_libsWithStripDebugSymbolForF0Debug
:processF0DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForF0Debug
:validateSigningF0Arm64-v8aDebug
:packageF0Arm64-v8aDebug
:assembleF0Arm64-v8aDebug
:validateSigningF0Armeabi-v7aDebug
:packageF0Armeabi-v7aDebug
:assembleF0Armeabi-v7aDebug
:validateSigningF0X86Debug
:packageF0X86Debug
:assembleF0X86Debug
:compileF0DebugSources
:buildMetadata
:assembleF0Debug
:assembleDebug
:buildapk

Possible solution/implementation:

Force the buildMetadata build step to execute before assembly and packaging of application package assets.

Reproduction steps/repo (if applicable):

Configure ABI splits and tns build android

Workaround:

Do another tns build android, and the metadata assets will once again be present in the APK because at the time of the packaging step metadata files will be where they need to be.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions