Title: NG Android (using Button) crashes with SIGABRT on API Level 21 · Issue #4256 · NativeScript/NativeScript · GitHub
Open Graph Title: NG Android (using Button) crashes with SIGABRT on API Level 21 · Issue #4256 · NativeScript/NativeScript
X Title: NG Android (using Button) crashes with SIGABRT on API Level 21 · Issue #4256 · NativeScript/NativeScript
Description: We faced the issue that our App crashes on Android 5.0 where it is working fine on Android 4.2 and higher versions. I cannot reproduce that on a sample app but here are the crash details: F/libc ( 3228): Fatal signal 6 (SIGABRT), code -6...
Open Graph Description: We faced the issue that our App crashes on Android 5.0 where it is working fine on Android 4.2 and higher versions. I cannot reproduce that on a sample app but here are the crash details: F/libc ( ...
X Description: We faced the issue that our App crashes on Android 5.0 where it is working fine on Android 4.2 and higher versions. I cannot reproduce that on a sample app but here are the crash details: F/libc ( ...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/4256
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NG Android (using Button) crashes with SIGABRT on API Level 21","articleBody":"We faced the issue that our App crashes on Android 5.0 where it is working fine on Android 4.2 and higher versions. I cannot reproduce that on a sample app but here are the crash details:\r\n\r\n```\r\nF/libc ( 3228): Fatal signal 6 (SIGABRT), code -6 in tid 3228 (eisen.piazza.nc)\r\nI/DEBUG ( 1163): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\r\nI/DEBUG ( 1163): Build fingerprint: 'generic_x86_64/sdk_google_phone_x86_64/generic_x86_64:5.0.2/LSY66K/3729068:eng/test-keys'\r\nI/DEBUG ( 1163): Revision: '0'\r\nI/DEBUG ( 1163): ABI: 'x86'\r\nI/DEBUG ( 1163): pid: 3228, tid: 3228, name: eisen.piazza.nc \u003e\u003e\u003e ch.myapp.nc \u003c\u003c\u003c\r\nI/DEBUG ( 1163): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------\r\nI/DEBUG ( 1163): Abort message: 'art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: can't call void android.view.View.setTranslationZ(float) on null object'\r\nI/DEBUG ( 1163): eax 00000000 ebx 00000c9c ecx 00000c9c edx 00000006\r\nI/DEBUG ( 1163): esi f7756f08 edi 00000002\r\nI/DEBUG ( 1163): xcs 00000023 xds 0000002b xes 0000002b xfs 00000007 xss 0000002b\r\nI/DEBUG ( 1163): eip f76c4446 ebp 00000c9c esp ff7fe380 flags 00200286\r\nI/DEBUG ( 1163): \r\nI/DEBUG ( 1163): backtrace:\r\nI/DEBUG ( 1163): #00 pc 00075446 /system/lib/libc.so (tgkill+22)\r\nI/DEBUG ( 1163): #01 pc 00021b1b /system/lib/libc.so (pthread_kill+155)\r\nI/DEBUG ( 1163): #02 pc 00023394 /system/lib/libc.so (raise+36)\r\nI/DEBUG ( 1163): #03 pc 0001b874 /system/lib/libc.so (abort+84)\r\nI/DEBUG ( 1163): #04 pc 003735e6 /system/lib/libart.so (art::Runtime::Abort()+294)\r\nI/DEBUG ( 1163): #05 pc 000ec304 /system/lib/libart.so (art::LogMessage::~LogMessage()+1668)\r\nI/DEBUG ( 1163): #06 pc 00101598 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1656)\r\nI/DEBUG ( 1163): #07 pc 00101ecc /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+108)\r\nI/DEBUG ( 1163): #08 pc 00102308 /system/lib/libart.so (art::ScopedCheck::CheckVirtualMethod(_jobject*, _jmethodID*)+504)\r\nI/DEBUG ( 1163): #09 pc 00112cdf /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, char*)+143)\r\nI/DEBUG ( 1163): #10 pc 000754c9 /system/lib/libandroid_runtime.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+41)\r\nI/DEBUG ( 1163): #11 pc 0011f059 /system/lib/libandroid_runtime.so\r\nI/DEBUG ( 1163): #12 pc 00089646 /data/dalvik-cache/x86/system@framework@boot.oat\r\n```\r\n\r\nI traced that down to be related to the android.view.Button(). It is instantiated using the default constructor which uses the default style which in turn sets the StateListAnimator of the View. At that point the `target` property is properly attached to the ObjectAnimator but once `setNative` is invoked and with it [button.android.ts#L117](https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/button/button.android.ts#L117) the StateListAnimator is set to null and with it the target of the ObjectAnimator. This is the causing the error in the Thread handling the animation. \r\n\r\nIn my application I patched tns-core-modules/ui/button.android.js to use `APILEVEL \u003e 21` instead of `APILEVEL \u003e= 21` which resolves the crash though its not the root cause I think. \r\n\r\nI think that on Button instantiation the animation is queued as pending animation in another thread while setNative is called and resets the target of the ObjectAnimator on the UI thread. A better approach then calling setStateListAnimator(null) would be to instantiate the Button with a style and define it in the style so it is already set to null at instantiation time.\r\n\r\n\u003cbountysource-plugin\u003e\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/45485880-ng-android-using-button-crashes-with-sigabrt-on-api-level-21?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github).\r\n\u003c/bountysource-plugin\u003e","author":{"url":"https://github.com/buuhuu","@type":"Person","name":"buuhuu"},"datePublished":"2017-05-23T13:31:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/4256/NativeScript/issues/4256"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7c8ad185-b377-1c5e-2092-37f8d0f50d0d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E51E:B4049:27BD64:330A52:69743900 |
| html-safe-nonce | a027a2f0e47bd66ac88898c1b580cd3cdd90fee1cbe3cc05456c7a4d698adda1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTFFOkI0MDQ5OjI3QkQ2NDozMzBBNTI6Njk3NDM5MDAiLCJ2aXNpdG9yX2lkIjoiMTY0OTgxODczMjU1MDQzNzEyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9d09c4e3673a7cec933a052b647eb347a1237d84eeafff7fae1c1daa08b19649 |
| hovercard-subject-tag | issue:230707589 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/4256/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d96b38500f715ade17be3eedae5167e0972de5812febf12316c3a50e507adea2/NativeScript/NativeScript/issues/4256 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d96b38500f715ade17be3eedae5167e0972de5812febf12316c3a50e507adea2/NativeScript/NativeScript/issues/4256 |
| og:image:alt | We faced the issue that our App crashes on Android 5.0 where it is working fine on Android 4.2 and higher versions. I cannot reproduce that on a sample app but here are the crash details: F/libc ( ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | buuhuu |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width