Java 尝试使用Reformation@Streaming annotation下载大文件时发生OutOfMemoryError

Java 尝试使用Reformation@Streaming annotation下载大文件时发生OutOfMemoryError,java,android,kotlin,retrofit,kotlin-coroutines,Java,Android,Kotlin,Retrofit,Kotlin Coroutines,我正在使用改装客户端下载文件,但当有大文件(200 MB)时,它会抛出java.lang.OutOfMemoryError: 我还有@Streaming注释,这是我的下载服务方法 @Streaming @GET("{path}") suspend fun downloadFile(@Path("path") path: String): Response<ResponseBody>` 改装版本=2.6.0 协同程序版本=1.3.0-M1尝试使用下载管理器下载大文件 您可以通过@co

我正在使用改装客户端下载文件,但当有大文件(200 MB)时,它会抛出
java.lang.OutOfMemoryError:
我还有
@Streaming
注释,这是我的下载服务方法

@Streaming
@GET("{path}")
suspend fun downloadFile(@Path("path") path: String): Response<ResponseBody>`
改装版本=
2.6.0


协同程序版本=
1.3.0-M1

尝试使用下载管理器下载大文件

您可以通过@commonware在这里找到完整的示例


我通过将
HttpLogingInterceptor
日志级别从
BODY
更改为
HEADERS

HttpLoggingInterceptor().apply {
   level = HttpLoggingInterceptor.Level.HEADERS
})
似乎奇怪的错误修复,但它的工作

HttpLoggingInterceptor().apply {
   level = HttpLoggingInterceptor.Level.HEADERS
})