Hello,
I have an app where I use DownloadService to download and save files. Up until recently it worked fine on my test device (Huawei P20 lite, Android 9, EMUI 9.1.0), but about 3 weeks ago it started crashing on downloading file without any message.
I use the DownloadService like this (I deliberately ommited url variable since it is a production server):
And in the DownloadService module I have pinned the problem down to this sub:
And here is the unfiltered log output:
*** Service (downloadservice) Create ***
** Service (downloadservice) Start **
Starting download
1
2
3
4
DownloadService StartTimer
5
6
7
8
9
new HwNotificationEx
isPureColorIcon
mHWColorUtil is null get it agin
Called getWidth() on a recycle()'d bitmap! This is undefined behavior!
Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
Called getGenerationId() on a recycle()'d bitmap! This is undefined behavior!
Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
Called getWidth() on a recycle()'d bitmap! This is undefined behavior!
Error, cannot access an invalid/free'd bitmap here!
Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 24519 (psoftware.kompa), pid 24519 (psoftware.kompa)
obtaining output fd from tombstoned, type: kDebuggerdTombstone
received crash request for pid 24519
performing dump of process 24519 (target tid = 24519)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
So, I guess it starts crashing on this line
I have tried commenting the line out, and I the app doesn't crash, but what bothers me is that it crashes randomly. My guess is that this is something to do with the Icon bitmap, since in the log it is mentioned a few times.
Also, I don't know if I made something else worse by commenting the "n.setinfo" line.
I will appreciate any advice on this matter.
I have an app where I use DownloadService to download and save files. Up until recently it worked fine on my test device (Huawei P20 lite, Android 9, EMUI 9.1.0), but about 3 weeks ago it started crashing on downloading file without any message.
I use the DownloadService like this (I deliberately ommited url variable since it is a production server):
B4X:
Dim dd As DownloadData
dd.url = url
dd.EventName = "dd"
dd.Target = Me
ProgressBar1.Visible=True
Sleep(100)
CallSubDelayed2(DownloadService, "StartDownload", dd)
And in the DownloadService module I have pinned the problem down to this sub:
B4X:
Private Sub StartTimer (Target As Object)
Log("DownloadService StartTimer")
Dim n As Notification
n.Initialize
Log("5")
n.Icon = "icon"
Log("6")
n.Vibrate = False
Log("7")
n.Sound = False
Log("8")
n.Light = False
Log("9")
n.SetInfo("Downloading file...", "", Target)
Log("10")
Service.StartForeground(1, n)
Log("11")
timer1.Enabled = True
Log("12")
pw.PartialLock
Log("13")
End Sub
And here is the unfiltered log output:
*** Service (downloadservice) Create ***
** Service (downloadservice) Start **
Starting download
1
2
3
4
DownloadService StartTimer
5
6
7
8
9
new HwNotificationEx
isPureColorIcon
mHWColorUtil is null get it agin
Called getWidth() on a recycle()'d bitmap! This is undefined behavior!
Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
Called getGenerationId() on a recycle()'d bitmap! This is undefined behavior!
Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
Called getWidth() on a recycle()'d bitmap! This is undefined behavior!
Error, cannot access an invalid/free'd bitmap here!
Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 24519 (psoftware.kompa), pid 24519 (psoftware.kompa)
obtaining output fd from tombstoned, type: kDebuggerdTombstone
received crash request for pid 24519
performing dump of process 24519 (target tid = 24519)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
So, I guess it starts crashing on this line
B4X:
n.SetInfo("Downloading file...", "", Target)
I have tried commenting the line out, and I the app doesn't crash, but what bothers me is that it crashes randomly. My guess is that this is something to do with the Icon bitmap, since in the log it is mentioned a few times.
Also, I don't know if I made something else worse by commenting the "n.setinfo" line.
I will appreciate any advice on this matter.