-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retrofit or okhttp get stuck #269
Comments
it get stuck on button click and click will fire retrofit call |
All version have this bug,you can try it |
This will probably need to be rewritten using coroutines instead. And screenshots with code are better replaced with the code itself, ideally something that is small and standalone so that it can be debugged. |
Coroutines or Thread shouldn't matter, |
This is a simple demo to test. import androidx.compose.desktop.Window
import androidx.compose.material.Text
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import okhttp3.*
import java.io.IOException
import java.nio.charset.StandardCharsets
fun main() = Window {
var text by remember { mutableStateOf("request url") }
MaterialTheme {
Button(onClick = {
val client = OkHttpClient()
val request = Request.Builder()
.url("http://www.github.com")
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
}
override fun onResponse(call: Call, response: Response) {
text = String(response.body!!.bytes(), StandardCharsets.UTF_8)
}
})
}) {
Text(text)
}
}
} implementation("com.squareup.okhttp3:okhttp:4.9.0")
|
Release will get stuck |
You can try to make it work fine,Maybe I have a problem with it |
Please try to log, if exception is thrown, it could be result of some library not included into native library. |
Just get stuck,no log,no exception. |
@s949492225 could you try adding
|
no,not work |
Without additional info it's hard to debug this issue. |
demo is here,just try it |
I am not able to reproduce the issue with:
@s949492225 I've created a repo with the sample, can you try it to see if the issue still reproduces? |
Compose Desktop 0.3.0 work fine; |
Without this module most of https is not going to work (see JetBrains#269 or JetBrains#429) The inclusion of this module increases a size of a prepackaged app by ~440 kb and of a packaged dmg by ~167 kb
Doesn't work for me, even with |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
i use retrofit/okhttp3
if it run on idea,it work fine,
bug package exe or dmg,open it will get stuck.
i fire retrofit on Thread,and callback on awt javax.swing.SwingUtilities.invokeLater
this is my key code:
The text was updated successfully, but these errors were encountered: