4Q-s-r-o / ota_update

Flutter plugin implementing OTA update for both iOS and Android
MIT License
182 stars 62 forks source link

When the server stops responding, the download is stuck at ''Downloading'' forever #89

Closed ElegantCrab closed 1 year ago

ElegantCrab commented 1 year ago

I'm using an API that I coded to hand over the new APK and it works perfectly fine when all is according to how it's supposed to work

However, if I stop my API to cause an error, the download is stuck forever there

This is the error

/System.out(11139): [socket]:check permission begin! W/System (11139): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar I/System.out(11139): [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils 3283 [log] DOWNLOADING

I/okhttp.OkHttpClient(11139): Callback failure for call to http://192.168.1.100/... I/okhttp.OkHttpClient(11139): java.net.SocketException: Connection reset I/okhttp.OkHttpClient(11139): at java.net.SocketInputStream.read(SocketInputStream.java:215) I/okhttp.OkHttpClient(11139): at java.net.SocketInputStream.read(SocketInputStream.java:144) I/okhttp.OkHttpClient(11139): at okio.InputStreamSource.read(JvmOkio.kt:90) I/okhttp.OkHttpClient(11139): at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129) I/okhttp.OkHttpClient(11139): at okio.RealBufferedSource.read(RealBufferedSource.kt:189) I/okhttp.OkHttpClient(11139): at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.kt:331) I/okhttp.OkHttpClient(11139): at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.kt:368) I/okhttp.OkHttpClient(11139): at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276) I/okhttp.OkHttpClient(11139): at okio.RealBufferedSource.read(RealBufferedSource.kt:189) I/okhttp.OkHttpClient(11139): at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.kt:331) I/okhttp.OkHttpClient(11139): at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.kt:368) I/okhttp.OkHttpClient(11139): at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:276) I/okhttp.OkHttpClient(11139): at okio.RealBufferedSource.read(RealBufferedSource.kt:189) I/okhttp.OkHttpClient(11139): at okio.ForwardingSource.read(ForwardingSource.kt:29) I/okhttp.OkHttpClient(11139): at sk.fourq.otaupdate.ProgressResponseBody$1.read(ProgressResponseBody.java:55) I/okhttp.OkHttpClient(11139): at okio.RealBufferedSource.read(RealBufferedSource.kt:189) I/okhttp.OkHttpClient(11139): at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:190) I/okhttp.OkHttpClient(11139): at sk.fourq.otaupdate.OtaUpdatePlugin$1.onResponse(OtaUpdatePlugin.java:240) I/okhttp.OkHttpClient(11139): at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) I/okhttp.OkHttpClient(11139): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) I/okhttp.OkHttpClient(11139): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) I/okhttp.OkHttpClient(11139): at java.lang.Thread.run(Thread.java:923)

MartinHlavna commented 1 year ago

Thanks for the report. Will be fixed in next release.

MartinHlavna commented 1 year ago

Fix released in 4.0.2

Notopponent commented 1 year ago

@MartinHlavna I am using version 4.0.2, the above problem still exists, why?