Closed wendt88 closed 3 years ago
I have run the code snippet you provided and cannot reproduce the error. Please create an example project demonstrating the issue.
it occures not every time (on my emulator or even phone ca in 80% of the cases)
I ran the test again today and I'm still unable to reproduce the issue. Are you able to setup an example repo?
here you can find an example
just clone and run tns run android
inside the app click the 'download'-button
Thanks, I cloned your demo repository and ran the example without any issues.
What version of the android sdk do you have installed?
with the 29: tns run android --compileSdk 29
I added a log inside the app and made a video:
I managed to cause the issue once and have not been able to replicate it again.
Could you please set supressCallJSMethodExceptions: true to prevent the application crashing and add some logging using the trace module so we can try to find the error.
I added "discardUncaughtJsExceptions": true
to my app/package.json
, like here right? But get no error.
In debug mode, at least the com.tns.ErrorReportActivity
-activity should open, but the app crashes without error. it seems more like a out of memory or something like this, not properly a js/code error.
Please can you try nativescript-download-progress@next
Please can you try nativescript-download-progress@next
now it crashes on every 3-5th run. before it crashed at 90%, so it is much better, but not safe enough for my use case :/
now i debuged with Android studio
and before he started to download the last file (before it crashed), i got the followed error inside the logcat
:
NativeAlloc concurrent copying GC freed 3625(323KB) AllocSpace objects, 4(80KB) LOS objects, 49% free, 2924KB/5848KB, paused 5.726ms total 75.313ms
is it helpful?
Could you please try restructuring your code, move the DownloadProgress instantiation outside of the for loop..
await folder.clear();
const download = new DownloadProgress();
for (let i in fileUrls) {
download.addProgressCallback(progress => {})
now i was able to download 100 files in a row multiple time without crash, thank you very much!
i saw, that i tried already to move it outside the loop in my main repo, without success, so 1.4.2-rc1
seems to fix this issue
tns info:
code example:
calling the download method, the app crashes after the 2nd file without error, or the app gets frozen. when I debug it and keep the breakpoint after every file for a few seconds, it works sometimes.