Skip to content

targetSDK升级到30后无法正常使用 #506

@shijia109

Description

@shijia109

OkDownload Version

v1.0.8

Problem Describe

如题,升级targetsdk到30后,demo无法正常下载,log有报错,不知道原因

Log

2023-12-12 20:31:54.511 17274-17274/com.liulishuo.okdownload.sample D/DownloadDispatcher: enqueueLocked for single task: com.liulishuo.okdownload.DownloadTask@ad87d5c1@1@https://cdn.llscdn.com/yy/files/xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk@/storage/emulated/0/Android/data/com.liulishuo.okdownload.sample/cache/null
2023-12-12 20:31:54.513 17274-17378/com.liulishuo.okdownload.sample D/CallbackDispatcher: taskStart: 1
2023-12-12 20:31:54.518 17274-17378/com.liulishuo.okdownload.sample I/TetheringManager: registerTetheringEventCallback:com.liulishuo.okdownload.sample
2023-12-12 20:31:54.559 17274-17378/com.liulishuo.okdownload.sample D/CallbackDispatcher: -----> start trial task(1) {range=[bytes=0-0]}
2023-12-12 20:31:54.861 17274-17378/com.liulishuo.okdownload.sample D/ConnectTrial: task[1] redirect location: null
2023-12-12 20:31:54.863 17274-17378/com.liulishuo.okdownload.sample D/CallbackDispatcher: <----- finish trial task(1) code[206]{accept-ranges=[bytes], access-control-allow-origin=[], access-control-expose-headers=[X-Log, X-Reqid, Content-Length], access-control-max-age=[2592000], cache-control=[public, max-age=31536000], content-disposition=[attachment; filename="xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk"; filename=utf-8''xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk], content-length=[1], content-range=[bytes 0-0/43994005], content-transfer-encoding=[binary], content-type=[application/vnd.android.package-archive], date=[Tue, 12 Dec 2023 12:31:53 GMT], etag=["lspklu1kkBkLwQipDy2CCLJRtTUl"], last-modified=[Mon, 11 Dec 2017 07:58:13 GMT], server=[openresty], timing-allow-origin=[], x-bill=[Tbl:llss;FileType:0], x-cache=[HIT from BC31_dx-jiangsu-xuzhou-22-cache-1(baishan)], x-log=[X-Log], x-m-log=[QNM:xs1171;QNM3:56], x-m-reqid=[NIkAADsfwreUfJ0X], x-qnm-cache=[MissFg], x-reqid=[uLsAAACi528BzpcX], x-ser=[BC146_dx-lt-yd-jiangsu-huaian-25-cache-2, BC31_dx-jiangsu-xuzhou-22-cache-1]}
2023-12-12 20:31:54.863 17274-17378/com.liulishuo.okdownload.sample D/DownloadDispatcher: is file conflict after run: 1
2023-12-12 20:31:54.864 17274-17378/com.liulishuo.okdownload.sample D/DownloadCall: breakpoint invalid: download from beginning because of local check is dirty 1 fileExist[true] infoRight[false] outputStreamSupport[true] com.liulishuo.okdownload.core.download.BreakpointLocalCheck@fee54b0
2023-12-12 20:31:54.875 17274-17378/com.liulishuo.okdownload.sample D/CallbackDispatcher: downloadFromBeginning: 1
2023-12-12 20:31:54.877 17274-17391/com.liulishuo.okdownload.sample D/DownloadChain: create connection on url: https://cdn.llscdn.com/yy/files/xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk
2023-12-12 20:31:54.878 17274-17391/com.liulishuo.okdownload.sample D/HeaderInterceptor: AssembleHeaderRange (1) block(2) downloadFrom(29329337) currentOffset(0)
2023-12-12 20:31:54.878 17274-17391/com.liulishuo.okdownload.sample D/CallbackDispatcher: -----> start connection task(1) block(2) {if-match=["lspklu1kkBkLwQipDy2CCLJRtTUl"], range=[bytes=29329337-43994004]}
2023-12-12 20:31:54.879 17274-17390/com.liulishuo.okdownload.sample D/DownloadChain: create connection on url: https://cdn.llscdn.com/yy/files/xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk
2023-12-12 20:31:54.880 17274-17389/com.liulishuo.okdownload.sample D/DownloadChain: create connection on url: https://cdn.llscdn.com/yy/files/xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk
2023-12-12 20:31:54.882 17274-17390/com.liulishuo.okdownload.sample D/HeaderInterceptor: AssembleHeaderRange (1) block(1) downloadFrom(14664669) currentOffset(0)
2023-12-12 20:31:54.882 17274-17389/com.liulishuo.okdownload.sample D/HeaderInterceptor: AssembleHeaderRange (1) block(0) downloadFrom(0) currentOffset(0)
2023-12-12 20:31:54.882 17274-17390/com.liulishuo.okdownload.sample D/CallbackDispatcher: -----> start connection task(1) block(1) {if-match=["lspklu1kkBkLwQipDy2CCLJRtTUl"], range=[bytes=14664669-29329336]}
2023-12-12 20:31:54.882 17274-17389/com.liulishuo.okdownload.sample D/CallbackDispatcher: -----> start connection task(1) block(0) {if-match=["lspklu1kkBkLwQipDy2CCLJRtTUl"], range=[bytes=0-14664668]}
2023-12-12 20:31:54.920 17274-17391/com.liulishuo.okdownload.sample D/CallbackDispatcher: <----- finish connection task(1) block(2) code[206]{accept-ranges=[bytes], access-control-allow-origin=[
], access-control-expose-headers=[X-Log, X-Reqid, Content-Length], access-control-max-age=[2592000], cache-control=[public, max-age=31536000], content-disposition=[attachment; filename="xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk"; filename*=utf-8''xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk], content-length=[14664668], content-range=[bytes 29329337-43994004/43994005], content-transfer-encoding=[binary], content-type=[application/vnd.android.package-archive], date=[Tue, 12 Dec 2023 12:31:53 GMT], etag=["lspklu1kkBkLwQipDy2CCLJRtTUl"], last-modified=[Mon, 11 Dec 2017 07:58:13 GMT], server=[openresty], timing-allow-origin=[], x-bill=[Tbl:llss;FileType:0], x-cache=[HIT from BC31_dx-jiangsu-xuzhou-22-cache-1(baishan)], x-log=[X-Log], x-m-log=[QNM:xs1171;QNM3:56], x-m-reqid=[NIkAADsfwreUfJ0X], x-qnm-cache=[MissFg], x-reqid=[uLsAAACi528BzpcX], x-ser=[BC146_dx-lt-yd-jiangsu-huaian-25-cache-2, BC31_dx-jiangsu-xuzhou-22-cache-1]}
2023-12-12 20:31:54.920 17274-17391/com.liulishuo.okdownload.sample D/CallbackDispatcher: fetchStart: 1
2023-12-12 20:31:54.921 17274-17391/com.liulishuo.okdownload.sample D/MultiPointOutputStream: Create new file: xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk
2023-12-12 20:31:54.923 17274-17391/com.liulishuo.okdownload.sample D/MultiPointOutputStream: Create output stream write from (1) block(2) 29329337
2023-12-12 20:31:54.926 17274-17391/com.liulishuo.okdownload.sample W/DownloadUriOutputStream: fallocate() not supported; falling back to ftruncate()
2023-12-12 20:31:54.927 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream start flush looper task[1] with syncBufferIntervalMills[2000] syncBufferSize[65536]
2023-12-12 20:31:54.928 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(2) syncLength(4096) currentOffset(4096)
2023-12-12 20:31:55.140 17274-17390/com.liulishuo.okdownload.sample D/CallbackDispatcher: <----- finish connection task(1) block(1) code[206]{accept-ranges=[bytes], access-control-allow-origin=[
], access-control-expose-headers=[X-Log, X-Reqid, Content-Length], access-control-max-age=[2592000], cache-control=[public, max-age=31536000], content-disposition=[attachment; filename="xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk"; filename*=utf-8''xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk], content-length=[14664668], content-range=[bytes 14664669-29329336/43994005], content-transfer-encoding=[binary], content-type=[application/vnd.android.package-archive], date=[Tue, 12 Dec 2023 12:31:53 GMT], etag=["lspklu1kkBkLwQipDy2CCLJRtTUl"], last-modified=[Mon, 11 Dec 2017 07:58:13 GMT], server=[openresty], timing-allow-origin=[], x-bill=[Tbl:llss;FileType:0], x-cache=[HIT from BC31_dx-jiangsu-xuzhou-22-cache-1(baishan)], x-log=[X-Log], x-m-log=[QNM:xs1171;QNM3:56], x-m-reqid=[NIkAADsfwreUfJ0X], x-qnm-cache=[MissFg], x-reqid=[uLsAAACi528BzpcX], x-ser=[BC146_dx-lt-yd-jiangsu-huaian-25-cache-2, BC31_dx-jiangsu-xuzhou-22-cache-1]}
2023-12-12 20:31:55.140 17274-17390/com.liulishuo.okdownload.sample D/CallbackDispatcher: fetchStart: 1
2023-12-12 20:31:55.144 17274-17389/com.liulishuo.okdownload.sample D/CallbackDispatcher: <----- finish connection task(1) block(0) code[206]{accept-ranges=[bytes], access-control-allow-origin=[
], access-control-expose-headers=[X-Log, X-Reqid, Content-Length], access-control-max-age=[2592000], cache-control=[public, max-age=31536000], content-disposition=[attachment; filename="xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk"; filename*=utf-8''xs8qmxn8-lls-LLS-5.8-800-20171207-111607.apk], content-length=[14664669], content-range=[bytes 0-14664668/43994005], content-transfer-encoding=[binary], content-type=[application/vnd.android.package-archive], date=[Tue, 12 Dec 2023 12:31:53 GMT], etag=["lspklu1kkBkLwQipDy2CCLJRtTUl"], last-modified=[Mon, 11 Dec 2017 07:58:13 GMT], server=[openresty], timing-allow-origin=[*], x-bill=[Tbl:llss;FileType:0], x-cache=[HIT from BC31_dx-jiangsu-xuzhou-22-cache-1(baishan)], x-log=[X-Log], x-m-log=[QNM:xs1171;QNM3:56], x-m-reqid=[NIkAADsfwreUfJ0X], x-qnm-cache=[MissFg], x-reqid=[uLsAAACi528BzpcX], x-ser=[BC146_dx-lt-yd-jiangsu-huaian-25-cache-2, BC31_dx-jiangsu-xuzhou-22-cache-1]}
2023-12-12 20:31:55.144 17274-17389/com.liulishuo.okdownload.sample D/CallbackDispatcher: fetchStart: 1
2023-12-12 20:31:55.147 17274-17390/com.liulishuo.okdownload.sample D/MultiPointOutputStream: Create output stream write from (1) block(1) 14664669
2023-12-12 20:31:56.030 17274-17354/com.liulishuo.okdownload.sample D/RemitSyncExecutor: sync info with id: 1
2023-12-12 20:31:56.928 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: task[1] current need fetching block count 3 is not equal to no more stream block count 0
2023-12-12 20:31:57.139 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(0) syncLength(5290874) currentOffset(5290874)
2023-12-12 20:31:57.140 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(1) syncLength(7043955) currentOffset(7043955)
2023-12-12 20:31:57.141 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(2) syncLength(11660111) currentOffset(11664207)
2023-12-12 20:31:57.831 17274-17391/com.liulishuo.okdownload.sample D/MultiPointOutputStream: task[1] current need fetching block count 3 is not equal to no more stream block count 1
2023-12-12 20:31:57.831 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: task[1] current need fetching block count 3 is not equal to no more stream block count 1
2023-12-12 20:31:57.831 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: runSync state change isNoMoreStream[false] newNoMoreStreamBlockList[[2]]
2023-12-12 20:31:57.845 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(0) syncLength(3244032) currentOffset(8534906)
2023-12-12 20:31:57.845 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(1) syncLength(2228224) currentOffset(9272179)
2023-12-12 20:31:57.846 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream sync success (1) block(2) syncLength(3000461) currentOffset(14664668)
2023-12-12 20:31:57.846 17274-17391/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream close task[1] block[2]
2023-12-12 20:31:57.846 17274-17391/com.liulishuo.okdownload.sample D/CallbackDispatcher: fetchEnd: 1
2023-12-12 20:31:57.847 17274-17404/com.liulishuo.okdownload.sample D/DownloadChain: release connection com.liulishuo.okdownload.core.connection.DownloadOkHttp3Connection@94b4a61 task[1] block[2]
2023-12-12 20:31:58.729 17274-17389/com.liulishuo.okdownload.sample D/MultiPointOutputStream: task[1] current need fetching block count 3 is not equal to no more stream block count 2
2023-12-12 20:31:58.730 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: task[1] current need fetching block count 3 is not equal to no more stream block count 2
2023-12-12 20:31:58.730 17274-17392/com.liulishuo.okdownload.sample D/MultiPointOutputStream: runSync state change isNoMoreStream[false] newNoMoreStreamBlockList[[0]]
2023-12-12 20:31:58.840 17274-17390/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream done but no need to ensure sync, because the syncFuture.isDone[true] task[1] block[1]
2023-12-12 20:31:58.841 17274-17390/com.liulishuo.okdownload.sample D/MultiPointOutputStream: OutputStream close task[1] block[1]
2023-12-12 20:31:58.841 17274-17390/com.liulishuo.okdownload.sample D/DownloadCache: catch unknown error java.io.IOException: The current offset on block-info isn't update correct, 9272179 != 14664668 on 1
2023-12-12 20:31:58.842 17274-17404/com.liulishuo.okdownload.sample D/DownloadChain: release connection com.liulishuo.okdownload.core.connection.DownloadOkHttp3Connection@dbe6986 task[1] block[1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions