Browse Source

Fix unresolved reference error. See description.

New okio version is not on the release classpath but it is on the debug classpath. Since leakcanary has move to it, but retrofit2 still uses old. So need to explicitly use old api in code and suppress the deprecation.
renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
ed092d7af0
  1. 5
      app/src/main/java/awais/instagrabber/utils/MediaUploader.kt

5
app/src/main/java/awais/instagrabber/utils/MediaUploader.kt

@ -8,7 +8,7 @@ import awais.instagrabber.utils.BitmapUtils.ThumbnailLoadCallback
import awais.instagrabber.webservices.interceptors.AddCookiesInterceptor
import okhttp3.*
import okio.BufferedSink
import okio.source
import okio.Okio
import org.json.JSONObject
import java.io.File
import java.io.FileInputStream
@ -140,8 +140,9 @@ object MediaUploader {
}
@Throws(IOException::class)
@Suppress("DEPRECATION_ERROR")
override fun writeTo(sink: BufferedSink) {
inputStream.source().use { sink.writeAll(it) }
Okio.source(inputStream).use { sink.writeAll(it) }
}
}
}

Loading…
Cancel
Save