question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using 'request(): Request' is an error. moved to val

See original GitHub issue

When i use

val request = it.raw().request()

My build fails because of this error

Using 'request(): Request' is an error. moved to val

But if I try to access request using val request = it.raw().request then code builds successfully but Android Studio shows it as an error in UI saying Cannot access 'request': It is package private in 'Response'.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
farhadsabericommented, Oct 19, 2020

how to remove old okhttp form classpath?

3reactions
yschimkecommented, Jul 21, 2020

You also have 3.12.0 on your classpath, hence the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ResponseBody?' is an error. moved to val with okhttp - Stack ...
It looks like you're using OkHttp 4.0.0. The response.body() function has been deprecated. Instead, you need to access the body as a val, ......
Read more >
ResponseBody?' is an error. moved to val with okhttp-kotlin
It looks like you're using OkHttp 4.0.0. The response.body() function has been deprecated. Instead, you need to access the body as a val,...
Read more >
Android之升级OkHttp编译提示错误如下Using 'body()
' is an error. moved to val2 解决办法原来的代码val list = response.body().string()去掉()就可以了val list = response.body.string()...
Read more >
OkHttpClient - OkHttp - Square Open Source
Conversely, creating a client for each request wastes resources on idle pools. Use new OkHttpClient() to create a shared instance with the default...
Read more >
okhttp3.Request.kt Maven / Gradle / Ivy - Download JAR files
class Request internal constructor( @get:JvmName("url") val url: HttpUrl, ... message = "moved to val", replaceWith = ReplaceWith(expression = "url"), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found