nativescript-community / ui-canvas

Implement Canvas into your NativeScript apps.
https://nativescript-community.github.io/ui-canvas/
Apache License 2.0
31 stars 9 forks source link

My app crashes when touched `Canvas` via `setTimeout()` (NativeScript-Vue) #9

Closed aiya000 closed 3 years ago

aiya000 commented 4 years ago

Make sure to check the demo app(s) for sample usage

I checked.

Make sure to check the existing issues in this repository

I checked :+1:

If the demo apps cannot help and there is no issue for your problem, tell us about it

Hi, thank you for present good library!

I have a problem, that my app crashes when touched Canvas via setTimeout().

$ tns run android --bundle
...

...
ActivityManager: Process {app bundle id} (pid 26249) has died
ActivityManager: cleanUpApplicationRecord -- 26249

Please see below for my representation!

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

"dependencies": {
  "@nstudio/nativescript-checkbox": "^1.0.0",
  "@vue/devtools": "^5.1.0",
  "js-base64": "^2.5.1",
  "nativescript-canvas": "^2.1.8",
  "nativescript-mediafilepicker": "^2.0.16",
  "nativescript-plugin-firebase": "^9.0.1",
  "nativescript-socketio": "^3.3.1",
  "nativescript-theme-core": "^1.0.4",
  "nativescript-toasts": "^1.0.3",
  "nativescript-toasty": "^1.3.1",
  "nativescript-vue": "^2.0.0",
  "nativescript-vue-devtools": "^1.2.0",
  "nativescript-windowed-modal": "^6.0.0",
  "tns-core-modules": "~6.0.0",
  "vuex": "^3.0.1"
},
"devDependencies": {
  "@babel/core": "^7.0.0",
  "@babel/preset-env": "^7.0.0",
  "@types/async-lock": "^1.1.1",
  "@types/js-base64": "^2.3.1",
  "@typescript-eslint/parser": "^1.9.0",
  "async-lock": "^1.2.2",
  "babel-loader": "^8.0.2",
  "babel-traverse": "6.26.0",
  "babel-types": "6.26.0",
  "babylon": "6.18.0",
  "clean-webpack-plugin": "^0.1.19",
  "copy-webpack-plugin": "^4.5.2",
  "css-loader": "^1.0.0",
  "deprecated-decorator": "^0.1.6",
  "eslint": "^5.16.0",
  "eslint-config-standard": "^12.0.0",
  "eslint-plugin-import": "^2.17.3",
  "eslint-plugin-node": "^9.1.0",
  "eslint-plugin-promise": "^4.1.1",
  "eslint-plugin-standard": "^4.0.0",
  "eslint-plugin-vue": "^5.2.2",
  "js-sha256": "^0.9.0",
  "lazy": "1.0.11",
  "nativescript-dev-webpack": "~1.0.0",
  "nativescript-urlhandler": "^1.3.0",
  "nativescript-vue-template-compiler": "^2.0.0",
  "nativescript-worker-loader": "~0.9.0",
  "node-sass": "^4.9.2",
  "sass-loader": "^7.1.0",
  "terser-webpack-plugin": "^1.1.0",
  "tns-platform-declarations": "6.0.1",
  "ts-node": "^8.2.0",
  "typescript": "^3.2.4",
  "utility-types": "^3.7.0",
  "vue": "^2.6.10",
  "vue-eslint-parser": "^6.0.4",
  "vue-loader": "^15.2.6",
  "vue-property-decorator": "^8.1.1",
  "webpack": "^4.16.4",
  "webpack-bundle-analyzer": "~2.13.1",
  "webpack-cli": "^3.1.0"
}

Please, tell us how to recreate the issue in as much detail as possible.

This problem ocurrs when this component's canvas.drawRect(new Rect(0, 0, 120, 150), new Paint()) is called.

<template>
    <CanvasView
        width="100"
        height="100"
        @draw="draw"
        />
</template>

<script lang="ts">

import { CanvasView, Canvas, Paint, Rect } from 'nativescript-canvas'
import { Component, Prop, Vue } from 'vue-property-decorator'

@Component
export default class PowerGraph extends Vue {
  public async draw({ canvas }: { canvas: Canvas }): Promise<void> {
    setTimeout(() => {
      canvas.drawRect(new Rect(0, 0, 120, 150), new Paint())
    }, 200)
  }
}

</script>

In my opinion, this factor is setTimeout(), because below occurs nothing.

<template>
    <CanvasView
        width="100"
        height="100"
        @draw="draw"
        />
</template>

<script lang="ts">

import { CanvasView, Canvas, Paint, Rect } from 'nativescript-canvas'
import { Component, Prop, Vue } from 'vue-property-decorator'

@Component
export default class PowerGraph extends Vue {
  public async draw({ canvas }: { canvas: Canvas }): Promise<void> {
    canvas.drawRect(new Rect(0, 0, 120, 150), new Paint())
  }
}

</script>

Please help me x(

Thanks!

farfromrefug commented 4 years ago

@aiya000 There s not enough log to debug anything. Please post a logcat

aiya000 commented 4 years ago

@farfromrefug logcat is here

logcat ```shell-session 09-24 13:46:45.979 17473 17473 I art : System.exit called, status: 0 09-24 13:46:45.979 17473 17473 I AndroidRuntime: VM exiting with result code 0. 09-24 13:46:46.518 17504 17504 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<< 09-24 13:46:46.523 17504 17504 D AndroidRuntime: CheckJNI is OFF 09-24 13:46:46.558 17504 17504 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat 09-24 13:46:46.595 17504 17504 I Radio-JNI: register_android_hardware_Radio DONE 09-24 13:46:46.614 17504 17504 D AndroidRuntime: Calling main entry com.android.commands.am.Am 09-24 13:46:46.617 782 2231 I ActivityManager: START u0 {flg=0x10000000 cmp=org.nativescript.application/com.tns.NativeScriptActivity} from uid 2000 on display 0 09-24 13:46:46.635 17504 17504 D AndroidRuntime: Shutting down VM 09-24 13:46:46.718 17443 17443 W art : Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorr ectly overridden the package-private method in android.graphics.drawable.Drawable 09-24 13:46:46.733 1830 16659 I PBSessionCacheImpl: Deleted sessionId[8049994456953206] from persistence. 09-24 13:46:46.739 1830 2043 W SearchServiceCore: Abort, client detached. 09-24 13:46:46.743 1830 2043 I MicroDetector: Keeping mic open: false 09-24 13:46:46.744 1830 16319 I DeviceStateChecker: DeviceStateChecker cancelled 09-24 13:46:46.744 1830 16316 I MicroRecognitionRunner: Stopping hotword detection. 09-24 13:46:46.746 1830 16320 I MicroRecognitionRunner: Detection finished 09-24 13:46:46.753 1830 16325 I AudioController: internalShutdown 09-24 13:46:46.753 1830 16324 E AudioRecord-JNI: Error -4 during AudioRecord native read 09-24 13:46:46.805 200 17458 D audio_hw_primary: disable_audio_route: reset and update mixer path: audio-record 09-24 13:46:46.805 200 17458 D audio_hw_primary: disable_snd_device: snd_device(61: voice-rec-mic) 09-24 13:46:46.809 1830 16325 I MicrophoneInputStream: mic_close SR : 16000 CC : 16 SO : 1999 09-24 13:46:46.809 1830 16325 E AudioSource: Stop listening is called on already closed AudioSource 09-24 13:46:46.976 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> CreateElement(NativeFrame)' 09-24 13:46:46.992 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> CreateElement(NativePage)' 09-24 13:46:47.067 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> CreateElement(NativeActionBar)' 09-24 13:46:47.086 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> AppendChild(ElementNode(nativepage), ElementNode(nativeactionbar))' 09-24 13:46:47.090 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> CreateElement(nativecanvasview)' 09-24 13:46:47.100 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> AppendChild(ElementNode(nativepage), ElementNode(nativecanvasview))' 09-24 13:46:47.103 17443 17443 I JS : '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> AppendChild(ElementNode(nativeframe), ElementNode(nativepage))' 09-24 13:46:47.286 17443 17443 I art : Rejecting re-init on previously-failed class java.lang.Class 09-24 13:46:47.286 17443 17443 I art : Rejecting re-init on previously-failed class java.lang.Class 09-24 13:46:47.327 485 485 W Binder_3: type=1400 audit(0.0:8231): avc: denied { ioctl } for path="socket:[215825]" dev="sockfs" ino=215825 ioctlcmd=7704 scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.327 485 485 W Binder_3: type=1400 audit(0.0:8232): avc: denied { ioctl } for path="socket:[215825]" dev="sockfs" ino=215825 ioctlcmd=7704 scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.341 17443 17541 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 09-24 13:46:47.327 485 485 W Binder_3: type=1400 audit(0.0:8233): avc: denied { ioctl } for path="socket:[210418]" dev="sockfs" ino=210418 ioctlcmd=7704 scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.327 485 485 W Binder_3: type=1400 audit(0.0:8234): avc: denied { ioctl } for path="socket:[210418]" dev="sockfs" ino=210418 ioctlcmd=7704 scontext=u:r:surfaceflinger:s0 tcontext=u:r:surfaceflinger:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.347 2231 2231 W Binder_B: type=1400 audit(0.0:8235): avc: denied { ioctl } for path="socket:[214797]" dev="sockfs" ino=214797 ioctlcmd=7704 scontext=u:r:system_server:s0 tcontext=u:r:system_server:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.357 2231 2231 W Binder_B: type=1400 audit(0.0:8236): avc: denied { ioctl } for path="socket:[214797]" dev="sockfs" ino=214797 ioctlcmd=7704 scontext=u:r:system_server:s0 tcontext=u:r:system_server:s0 tclass=unix_stream_socket permissive=0 09-24 13:46:47.451 17443 17541 I Adreno-EGL: : QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb 09-24 13:46:47.457 17443 17541 I OpenGLRenderer: Initialized EGL, version 1.4 09-24 13:46:47.711 782 801 I ActivityManager: Displayed org.nativescript.application/com.tns.NativeScriptActivity: +1s75ms 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8237): avc: denied { search } for name="17520" dev="proc" ino=215794 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8238): avc: denied { search } for name="17520" dev="proc" ino=215794 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8239): avc: denied { search } for name="17520" dev="proc" ino=215794 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8240): avc: denied { search } for name="17521" dev="proc" ino=215795 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8241): avc: denied { search } for name="17521" dev="proc" ino=215795 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.936 951 951 W ProcessCpuTracker: Skipping unknown process pid 17520 09-24 13:46:47.936 951 951 W ProcessCpuTracker: Skipping unknown process pid 17521 09-24 13:46:47.937 951 951 W ProcessCpuTracker: Skipping unknown process pid 17522 09-24 13:46:47.937 951 951 W ProcessCpuTracker: Skipping unknown process pid 17523 09-24 13:46:47.937 951 951 W ProcessCpuTracker: Skipping unknown process pid 17524 09-24 13:46:47.937 951 951 W ProcessCpuTracker: Skipping unknown process pid 17525 09-24 13:46:47.938 951 951 W ProcessCpuTracker: Skipping unknown process pid 17528 09-24 13:46:47.938 951 951 W ProcessCpuTracker: Skipping unknown process pid 17532 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8242): avc: denied { search } for name="17521" dev="proc" ino=215795 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8243): avc: denied { search } for name="17522" dev="proc" ino=215796 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8244): avc: denied { search } for name="17522" dev="proc" ino=215796 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8245): avc: denied { search } for name="17522" dev="proc" ino=215796 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8246): avc: denied { search } for name="17523" dev="proc" ino=215797 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8247): avc: denied { search } for name="17523" dev="proc" ino=215797 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8248): avc: denied { search } for name="17523" dev="proc" ino=215797 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8249): avc: denied { search } for name="17524" dev="proc" ino=215798 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.927 951 951 W ndroid.systemui: type=1400 audit(0.0:8250): avc: denied { search } for name="17524" dev="proc" ino=215798 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:47.969 17443 17443 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x58 in tid 17443 (ipt.application) 09-24 13:46:48.071 197 197 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 09-24 13:46:48.071 197 197 F DEBUG : Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys' 09-24 13:46:48.071 197 197 F DEBUG : Revision: '11' 09-24 13:46:48.071 197 197 F DEBUG : ABI: 'arm' 09-24 13:46:48.071 197 197 F DEBUG : pid: 17443, tid: 17443, name: ipt.application >>> org.nativescript.application <<< 09-24 13:46:48.071 197 197 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x58 09-24 13:46:48.088 197 197 F DEBUG : r0 00000000 r1 00000000 r2 ff000000 r3 41400000 09-24 13:46:48.088 197 197 F DEBUG : r4 9de7bc60 r5 9df02320 r6 b6d6dec0 r7 bea0b9a4 09-24 13:46:48.088 197 197 F DEBUG : r8 aa747630 r9 9df02348 sl 00000000 fp 00000000 09-24 13:46:48.088 197 197 F DEBUG : ip 40800000 sp bea0b998 lr b5e05129 pc b5e0512c cpsr 000f0030 09-24 13:46:48.089 197 197 F DEBUG : 09-24 13:46:48.089 197 197 F DEBUG : backtrace: 09-24 13:46:48.089 197 197 F DEBUG : #00 pc 0002e12c /system/lib/libhwui.so (_ZN7android10uirenderer17DisplayListCanvas8drawRectEffffRK7SkPaint+263) 09-24 13:46:48.089 197 197 F DEBUG : #01 pc 7357b7db /data/dalvik-cache/arm/system@framework@boot.oat (offset 0x1ed6000) 09-24 13:46:48.173 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4476s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:46:48.494 197 197 F DEBUG : 09-24 13:46:48.494 197 197 F DEBUG : Tombstone written to: /data/tombstones/tombstone_00 09-24 13:46:48.494 197 197 E DEBUG : AM write failed: Broken pipe 09-24 13:46:48.494 782 17555 W ActivityManager: Force finishing activity org.nativescript.application/com.tns.NativeScriptActivity 09-24 13:46:48.494 782 799 I BootReceiver: Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE) 09-24 13:46:48.613 782 1045 D GraphicsStats: Buffer count: 2 09-24 13:46:48.615 782 2566 I WindowState: WIN DEATH: Window{22ea698 u0 org.nativescript.application/com.tns.NativeScriptActivity} 09-24 13:46:48.632 782 791 I art : Background partial concurrent mark sweep GC freed 12432(927KB) AllocSpace objects, 20(15MB) LOS objects, 26% free, 44MB/60MB, paused 2.962ms total 110.834ms 09-24 13:46:48.643 211 211 I Zygote : Process 17443 exited due to signal (11) 09-24 13:46:48.653 782 3178 I ActivityManager: Process org.nativescript.application (pid 17443) has died 09-24 13:46:48.653 782 3178 D ActivityManager: cleanUpApplicationRecord -- 17443 09-24 13:46:48.680 1830 1830 W SearchServiceClient: Starting with NO_SESSION handoverId is deprecated. Just don't. You will break. 09-24 13:46:48.680 1830 1830 W SearchServiceClient: com.google.android.apps.gsa.shared.util.a.g: SearchServiceClient: Starting with NO_SESSION handoverId is deprecated. Just don't. You will break. 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.apps.gsa.shared.util.a.d.a(SourceFile:40) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.apps.gsa.shared.util.a.d.d(SourceFile:6) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.apps.gsa.search.shared.service.z.a(SourceFile:110) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.apps.gsa.search.shared.service.z.d(SourceFile:96) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.apps.gsa.nowoverlayservice.aq.a(SourceFile:15) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.libraries.gsa.f.b.p.a(SourceFile:20) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.google.android.libraries.gsa.f.b.p.handleMessage(SourceFile:25) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at android.os.Handler.dispatchMessage(Handler.java:98) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at android.os.Looper.loop(Looper.java:148) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at android.app.ActivityThread.main(ActivityThread.java:5417) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at java.lang.reflect.Method.invoke(Native Method) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 09-24 13:46:48.680 1830 1830 W SearchServiceClient: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 09-24 13:46:48.681 1830 2043 W SessionLifecycleManager: Handover failed. Creating new session controller. 09-24 13:46:48.685 1830 2043 E PBSessionCacheImpl: sessionId[8049994456953206] not persisted. 09-24 13:46:48.688 1830 16324 I PBSessionCacheImpl: Deleted sessionId[8049994456953206] from persistence. 09-24 13:46:48.707 1830 2043 I MicroDetectionWorker: #startMicroDetector [speakerMode: 0] 09-24 13:46:48.709 1830 2043 I AudioController: Created new AudioSource 09-24 13:46:48.711 1830 2043 I MicroDetectionWorker: onReady 09-24 13:46:48.714 1830 16318 I MicroRecognitionRunner: Starting detection. 09-24 13:46:48.714 1830 16318 I MultipleReaderAudioSrc: Using micInputStream 09-24 13:46:48.715 1830 16324 I MicrophoneInputStream: mic_starting SR : 16000 CC : 16 SO : 1999 09-24 13:46:48.716 200 17578 I AudioFlinger: AudioFlinger's thread 0xb26c0000 ready to run 09-24 13:46:48.721 1830 16324 I MicrophoneInputStream: mic_started SR : 16000 CC : 16 SO : 1999 09-24 13:46:48.730 200 17578 D audio_hw_primary: select_devices: out_snd_device(0: none) in_snd_device(61: voice-rec-mic) 09-24 13:46:48.730 200 17578 D msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(61) acdb_id(62) 09-24 13:46:48.730 200 17578 D : Failed to fetch the lookup information of the device 0000003E 09-24 13:46:48.730 200 17578 E ACDB-LOADER: Error: ACDB AudProc vol returned = -19 09-24 13:46:48.730 200 17578 D audio_hw_primary: enable_snd_device: snd_device(61: voice-rec-mic) 09-24 13:46:48.736 200 17578 D audio_hw_primary: enable_audio_route: apply and update mixer path: audio-record 09-24 13:46:48.821 1830 2043 I MicroDetectionWorker: onReady 09-24 13:46:49.164 782 801 W WindowAnimator: Failed to dispatch window animation state change. 09-24 13:46:49.164 782 801 W WindowAnimator: android.os.DeadObjectException 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.BinderProxy.transactNative(Native Method) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.BinderProxy.transact(Binder.java:503) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534) 09-24 13:46:49.164 782 801 W WindowAnimator: at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286) 09-24 13:46:49.164 782 801 W WindowAnimator: at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678) 09-24 13:46:49.164 782 801 W WindowAnimator: at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java) 09-24 13:46:49.164 782 801 W WindowAnimator: at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.view.Choreographer.doCallbacks(Choreographer.java:670) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.view.Choreographer.doFrame(Choreographer.java:603) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.Handler.handleCallback(Handler.java:739) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.Handler.dispatchMessage(Handler.java:95) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.Looper.loop(Looper.java:148) 09-24 13:46:49.164 782 801 W WindowAnimator: at android.os.HandlerThread.run(HandlerThread.java:61) 09-24 13:46:49.164 782 801 W WindowAnimator: at com.android.server.ServiceThread.run(ServiceThread.java:46) 09-24 13:46:49.249 1517 1892 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer... 09-24 13:46:49.249 1517 1892 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer... 09-24 13:46:51.177 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4479s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:46:54.175 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4482s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:46:54.824 782 1312 D NetlinkSocketObserver: NeighborEvent{elapsedMs=5616328, 192.168.2.1, [BC5C4C60E501], RTM_NEWNEIGH, NUD_STALE} 09-24 13:46:57.177 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4485s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8262): avc: denied { search } for name="17589" dev="proc" ino=214843 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:shell:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8263): avc: denied { search } for name="17589" dev="proc" ino=214843 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:shell:s0 tclass=dir permissive=0 09-24 13:46:57.996 951 951 W ProcessCpuTracker: Skipping unknown process pid 17589 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8264): avc: denied { search } for name="17589" dev="proc" ino=214843 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:shell:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8265): avc: denied { search } for name="17592" dev="proc" ino=214856 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8266): avc: denied { search } for name="17592" dev="proc" ino=214856 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:58.000 951 951 W ProcessCpuTracker: Skipping unknown process pid 17592 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8267): avc: denied { search } for name="17592" dev="proc" ino=214856 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8268): avc: denied { search } for name="17593" dev="proc" ino=214857 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:58.002 951 951 W ProcessCpuTracker: Skipping unknown process pid 17593 09-24 13:46:58.003 951 951 W ProcessCpuTracker: Skipping unknown process pid 17594 09-24 13:46:58.003 951 951 W ProcessCpuTracker: Skipping unknown process pid 17595 09-24 13:46:58.004 951 951 W ProcessCpuTracker: Skipping unknown process pid 17596 09-24 13:46:58.004 951 951 W ProcessCpuTracker: Skipping unknown process pid 17597 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8269): avc: denied { search } for name="17593" dev="proc" ino=214857 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:58.005 951 951 W ProcessCpuTracker: Skipping unknown process pid 17598 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8270): avc: denied { search } for name="17593" dev="proc" ino=214857 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8271): avc: denied { search } for name="17594" dev="proc" ino=214858 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8272): avc: denied { search } for name="17594" dev="proc" ino=214858 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.987 951 951 W ndroid.systemui: type=1400 audit(0.0:8273): avc: denied { search } for name="17594" dev="proc" ino=214858 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8274): avc: denied { search } for name="17595" dev="proc" ino=214859 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8275): avc: denied { search } for name="17595" dev="proc" ino=214859 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8276): avc: denied { search } for name="17595" dev="proc" ino=214859 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8277): avc: denied { search } for name="17596" dev="proc" ino=214860 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8278): avc: denied { search } for name="17596" dev="proc" ino=214860 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8279): avc: denied { search } for name="17596" dev="proc" ino=214860 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8280): avc: denied { search } for name="17597" dev="proc" ino=214861 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:46:57.997 951 951 W ndroid.systemui: type=1400 audit(0.0:8281): avc: denied { search } for name="17597" dev="proc" ino=214861 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:kernel:s0 tclass=dir permissive=0 09-24 13:47:00.173 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4488s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:47:03.177 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4491s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ype}, btt{name=createdTimeMillis}, btt{name=modifiedTimeMillis}, bvu{name=localId}]){account=8484e996, submitTimeMs=1133463, startTimeMs=1133463, waitTimeMs=0, timedOut} 09-24 13:47:06.156 2469 2690 W CelloCake: [CelloTaskRunner8484e996-monitoring0] [Account=8484e996:Task=80221394]Slow task still running after 4494s. queryPaged(request=# com.google.apps.drive.dataservice.ItemQueryWithOptions@67426ab,fields=[btt{name=stableId}, btt{name=title}, btt{name=ownerEmail}, btt{name=mimeT ```

Maybe 09-24 13:46:49.164 is important.

Also you can reproduce this problem on below following :+1:

$ vue init nativescript-vue/vue-cli-template test
$ cd test
$ npm install --save-dev vue-property-decorator
$ tns plugin add nativescript-canvas
$ npm install
$ e app/main.ts app/components/App.vue  # Follow README 'NativeScript + Vue' and 'draw Method' of this repo
$ adb logcat
farfromrefug commented 4 years ago

I can't reproduce your error. happening on device or emulator? Can you give me the specs

brease-colin commented 3 years ago

I'm having the same (or similar) issue. I'm using an emulator on API 22.

Logcat ``` 08-17 12:54:45.654 I/ActivityManager( 1485): START u0 {flg=0x10000000 cmp=nl.***.***/com.tns.NativeScriptActivity} from uid 0 on display 0 08-17 12:54:45.654 V/WindowManager( 1485): addAppToken: AppWindowToken{2ce06129 token=Token{3ecf9eb0 ActivityRecord{283cd1f3 u0 nl.***.***/com.tns.NativeScriptActivity t64}}} to stack=1 task=64 at 0 08-17 12:54:45.657 V/WindowManager( 1485): Adding window Window{f0c93c8 u0 Starting nl.***.***} at 2 of 9 (after Window{ddcb088 u0 nl.***.***/com.tns.NativeScriptActivity EXITING}) 08-17 12:54:45.660 D/AndroidRuntime(18376): Shutting down VM 08-17 12:54:45.663 E/libprocessgroup(18387): failed to make and chown /acct/uid_10060: Read-only file system 08-17 12:54:45.663 W/Zygote (18387): createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT? 08-17 12:54:45.663 I/art (18387): Not late-enabling -Xcheck:jni (already on) 08-17 12:54:45.669 I/ActivityManager( 1485): Start proc 18387:nl.***.***/u0a60 for activity nl.***.***/com.tns.NativeScriptActivity 08-17 12:54:45.700 W/linker (18387): libNativeScript.so: unused DT entry: type 0x6ffffef5 arg 0x10b2d0 08-17 12:54:45.700 W/linker (18387): libNativeScript.so: unused DT entry: type 0x6ffffffe arg 0x13fa64 08-17 12:54:45.700 W/linker (18387): libNativeScript.so: unused DT entry: type 0x6fffffff arg 0x3 08-17 12:54:45.705 D/gralloc_ranchu( 1138): gralloc_alloc: Creating ashmem region of size 8294400 08-17 12:54:45.727 I/TNS.Runtime(18387): NativeScript Runtime Version 6.5.0, commit 06980ed0e5e2fae2c94a42808e858871cd349c81 08-17 12:54:45.774 D/TNS.Runtime(18387): V8 version 8.0.426.16 08-17 12:54:45.792 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:45.805 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:45.807 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:45.807 W/OpenGLRenderer( 2212): Incorrectly called buildLayer on View: aep, destroying layer... 08-17 12:54:45.808 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:45.822 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:46.038 D/AndroidRuntime(18414): >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<< 08-17 12:54:46.039 D/AndroidRuntime(18414): CheckJNI is ON 08-17 12:54:46.062 E/memtrack(18414): Couldn't load memtrack module (No such file or directory) 08-17 12:54:46.063 E/android.os.Debug(18414): failed to load memtrack module: -2 08-17 12:54:46.081 D/AndroidRuntime(18414): Calling main entry com.android.commands.pm.Pm 08-17 12:54:46.089 I/art (18414): System.exit called, status: 0 08-17 12:54:46.089 I/AndroidRuntime(18414): VM exiting with result code 0. 08-17 12:54:46.587 W/art (18387): Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 08-17 12:54:46.607 E/WakeLock( 2149): GCM_HB_ALARM release without a matched acquire! 08-17 12:54:46.614 I/art (18387): Background sticky concurrent mark sweep GC freed 3431(265KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 8MB/8MB, paused 8.871ms total 23.297ms 08-17 12:54:46.660 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(Frame) 08-17 12:54:46.671 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(Page) 08-17 12:54:46.680 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(gridlayout) 08-17 12:54:46.689 I/art ( 2282): Explicit concurrent mark sweep GC freed 27875(1174KB) AllocSpace objects, 0(0B) LOS objects, 11% free, 30MB/34MB, paused 1.416ms total 43.091ms 08-17 12:54:46.691 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(gridlayout) 08-17 12:54:46.696 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(label) 08-17 12:54:46.721 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(5), Label(6)) 08-17 12:54:46.724 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(canvasview) 08-17 12:54:46.729 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(5), CanvasView(7)) 08-17 12:54:46.729 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(label) 08-17 12:54:46.731 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(5), Label(8)) 08-17 12:54:46.736 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(4), GridLayout(5)) 08-17 12:54:46.738 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(gridlayout) 08-17 12:54:46.739 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> CreateElement(label) 08-17 12:54:46.739 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(9), Label(10)) 08-17 12:54:46.740 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(GridLayout(4), GridLayout(9)) 08-17 12:54:46.742 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(Page(3), GridLayout(4)) 08-17 12:54:46.744 I/JS (18387): {NSVue (Vue: 2.6.11 | NSVue: 2.7.1)} -> AppendChild(Frame(2), Page(3)) 08-17 12:54:46.865 I/art (18387): Rejecting re-init on previously-failed class java.lang.Class 08-17 12:54:46.865 I/art (18387): Rejecting re-init on previously-failed class java.lang.Class 08-17 12:54:46.885 E/Vold ( 1137): Failed to find mounted volume for /storage/sdcard/Android/data/nl.***.***/cache/ 08-17 12:54:46.885 W/Vold ( 1137): Returning OperationFailed - no handler for errno 0 08-17 12:54:46.886 W/ContextImpl(18387): Failed to ensure directory: /storage/sdcard/Android/data/nl.***.***/cache 08-17 12:54:46.927 D/OpenGLRenderer(18387): Use EGL_SWAP_BEHAVIOR_PRESERVED: true 08-17 12:54:46.928 D/ (18387): HostConnection::get() New Host Connection established 0xa21ccbf0, tid 18387 08-17 12:54:46.929 D/Atlas (18387): Validating map... 08-17 12:54:46.930 V/WindowManager( 1485): Adding window Window{a93916a u0 nl.***.***/com.tns.NativeScriptActivity} at 4 of 10 (before Window{f0c93c8 u0 Starting nl.***.***}) 08-17 12:54:46.973 D/ (18387): HostConnection::get() New Host Connection established 0xae85a2e0, tid 18437 08-17 12:54:46.974 I/OpenGLRenderer(18387): Initialized EGL, version 1.4 08-17 12:54:46.974 W/OpenGLRenderer(18387): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 08-17 12:54:46.988 D/EGL_emulation(18387): eglCreateContext: 0xae950220: maj 2 min 0 rcv 2 08-17 12:54:46.992 D/EGL_emulation(18387): eglMakeCurrent: 0xae950220: ver 2 0 (tinfo 0xae8394a0) 08-17 12:54:46.994 D/OpenGLRenderer(18387): Enabling debug mode 0 08-17 12:54:47.023 D/EGL_emulation(18387): eglMakeCurrent: 0xae950220: ver 2 0 (tinfo 0xae8394a0) 08-17 12:54:47.156 I/ActivityManager( 1485): Displayed nl.***.***/com.tns.NativeScriptActivity: +1s500ms (total +2s614ms) 08-17 12:54:47.163 I/MicrophoneInputStream( 2079): mic_close gzi@e6fd429 08-17 12:54:47.183 I/HotwordRecognitionRnr( 2079): Stopping hotword detection. 08-17 12:54:47.183 I/HotwordRecognitionRnr( 2079): Hotword detection finished 08-17 12:54:49.046 D/TaskPersister( 1485): removeObsoleteFile: deleting file=62_task.xml 08-17 12:54:52.110 I/Zygote ( 1150): Process 18387 exited due to signal (6) 08-17 12:54:52.110 W/InputDispatcher( 1485): channel 'a93916a nl.***.***/com.tns.NativeScriptActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 08-17 12:54:52.110 E/InputDispatcher( 1485): channel 'a93916a nl.***.***/com.tns.NativeScriptActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 08-17 12:54:52.111 I/WindowState( 1485): WIN DEATH: Window{a93916a u0 nl.***.***/com.tns.NativeScriptActivity} 08-17 12:54:52.111 W/InputDispatcher( 1485): Attempted to unregister already unregistered input channel 'a93916a nl.***.***/com.tns.NativeScriptActivity (server)' 08-17 12:54:52.111 W/libprocessgroup( 1485): failed to open /acct/uid_10060/pid_18387/cgroup.procs: No such file or directory 08-17 12:54:52.111 I/ActivityManager( 1485): Process nl.***.*** (pid 18387) has died 08-17 12:54:52.111 W/ActivityManager( 1485): Force removing ActivityRecord{283cd1f3 u0 nl.***.***/com.tns.NativeScriptActivity t64}: app died, no saved state 08-17 12:54:52.147 I/OpenGLRenderer( 2212): Initialized EGL, version 1.4 08-17 12:54:52.153 D/EGL_emulation( 2212): eglCreateContext: 0xa05d57c0: maj 2 min 0 rcv 2 08-17 12:54:52.155 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:52.184 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:52.234 W/InputMethodManagerService( 1485): Got RemoteException sending setActive(false) notification to pid 18387 uid 10060 08-17 12:54:52.279 V/RenderScript( 2212): 0xb41b1800 Launching thread(s), CPUs 2 08-17 12:54:52.343 I/MicrophoneInputStream( 2079): mic_starting gzi@ac2b45e 08-17 12:54:52.344 E/audio_hw_generic( 1147): Error opening input stream format 1, channel_mask 0010, sample_rate 16000 08-17 12:54:52.346 I/AudioFlinger( 1147): AudioFlinger's thread 0xb5a30000 ready to run 08-17 12:54:52.347 I/HotwordRecognitionRnr( 2079): Starting hotword detection. 08-17 12:54:52.347 I/MicrophoneInputStream( 2079): mic_started gzi@ac2b45e 08-17 12:54:52.347 I/Icing ( 2282): IndexChimeraService.getServiceInterface callingPackage=com.google.android.googlequicksearchbox componentName=null serviceId=21 08-17 12:54:52.350 W/Icing ( 2282): No valid account for uploading user actions 08-17 12:54:52.351 I/Icing ( 2282): Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0 08-17 12:54:52.370 I/HotwordWorker( 2079): onReady 08-17 12:54:52.753 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:52.762 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:52.764 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) 08-17 12:54:52.765 W/OpenGLRenderer( 2212): Incorrectly called buildLayer on View: aep, destroying layer... 08-17 12:54:52.766 D/EGL_emulation( 2212): eglMakeCurrent: 0xa05d57c0: ver 2 0 (tinfo 0xb43d5280) ```

Timeout of 5000ms has ended at 08-17 12:54:52.110.

Before the timeout, I'm drawing a circle, which goes well and is displayed. After a timeout (or interval, doesn't matter), I try to clear the canvas, but then the application crashes. Even a try / catch does nothing.

function draw(event: { canvas: Canvas })
        {
            const strokeWidth = 8;
            const margin = 20;

            const canvas = event.canvas;
            const paint = new Paint();
            paint.setColor(new Color('black'));
            paint.setStyle(Style.STROKE);
            paint.strokeWidth = strokeWidth;

            const minDimension = Math.min(canvas.getWidth(), canvas.getHeight());
            const radius = (minDimension - margin - strokeWidth) / 2;

            canvas.drawCircle(canvas.getWidth() / 2, canvas.getHeight() / 2, radius, paint);

            setTimeout(() => {
                try
                {
                    canvas!.clear();
                }
                catch (error)
                {
                    console.log(error);
                }
            }, 5000);
        }

Is it a problem with the low API version? I've had problems trying to draw RoundRect / Oval as well.

farfromrefug commented 3 years ago

@brease-colin that s actually normal. You cant use setTimeout in the onDraw method. The reason is that the "canvas" object is different during each call on android. The right way to do that is to call invalidate on the canvas view in your timeout. From the resulting on draw you simply do nothing.

brease-colin commented 3 years ago

That works great, thanks!