https://kotlinlang.org
Join Slack
What does it mean that the K2 mode is "not fully supported" for multipaltform projects? I followed t...
l

loke

over 1 year ago
What does it mean that the K2 mode is "not fully supported" for multipaltform projects? I followed the recommendations made above, and things seems to work for the most part, but I get a warning about it when I open a non-JVM source file.
l
a
  • 2
  • 4
  • 1035
what is the most efficient way to round `Double` up to certain decimal points, there is `round()` ...
d

Danish Ansari

almost 4 years ago
what is the most efficient way to round
Double
up to certain decimal points, there is
round()
function in Kotlin but it always completely rounds up to 0 decimals? I want something like
round(1.4999,decimalPrecision = 2) // 1.50
d
j
+2
  • 4
  • 29
  • 1035
is there a way to globally exclude a directory? we have some generated code checked in (yes… we know...
e

Eric

over 3 years ago
is there a way to globally exclude a directory? we have some generated code checked in (yes… we know). And want to exclude that directory from contributing to score and from being formatted automatically.
e
e
+2
  • 4
  • 6
  • 1032
I'm getting this error when working with 2.0.20-RC2-1.0.24 on js target. See thread:
r

Robert Jaros

11 months ago
I'm getting this error when working with 2.0.20-RC2-1.0.24 on js target. See thread:
r
e
  • 2
  • 4
  • 1029
How to use moko-mvvm ViewModel with Composable Screens?
a

Ahmad Hassan

over 2 years ago
How to use moko-mvvm ViewModel with Composable Screens?
a
a
  • 2
  • 12
  • 1029
I’m running kdoctor and I’m getting this error “Xcode requires to perform the First Launch tasks” ...
k

kevin

over 2 years ago
I’m running kdoctor and I’m getting this error “Xcode requires to perform the First Launch tasks” I’ve installed the latest version of kdoctor and the latest version of xcode and I’ve run xcode (I get the ‘welcome to xcode’ splash screen. Any ideas what the issue is? The (xcode) output from kdoctor -v is Xcode ➤ Xcode (14.2) Location: /Applications/Xcode.app ✖️ Xcode requires to perform the First Launch tasks Launch Xcode and complete setup i Xcode JAVA_HOME: /Users/kevinjones/Library/Java/JavaVirtualMachines/corretto-11.0.17/Contents/Home Xcode JAVA_HOME can be configured in Xcode -> Preferences -> Locations -> Custom Paths
k
d
k
  • 3
  • 3
  • 1028
I have some problem with suspend in a Interceptor. I use a interceptor to refresh token: ``` @Single...
a

Android75

about 4 years ago
I have some problem with suspend in a Interceptor. I use a interceptor to refresh token:
@Singleton
class RefreshInterceptor @Inject
constructor(
 private val savePrefSecurity: SavePrefSecurity
) : Interceptor {
   
    override fun intercept(chain: Interceptor.Chain): Response {

       
        var request = chain?.request()
        var response = chain!!.proceed(request)
           if (response.code == 401) {
            var refresh = savePrefSecurity.getSValue(REFRESH_TOKEN)
            if (!refresh.isNullOrBlank()) {
                )
                GlobalScope.launch {
                    var refrehResponse = api.refreshToken(sendRefresh)
                    [....}
                    // other code...
                     return@let intercept(chain)
                }
            }
}
   return response
1. how can i avoid GlobalScope ? because refreshToken is a supend function 2. i think that return@let intercept(chain) is inappropriate blockin
➕ 1
a
l
+2
  • 4
  • 3
  • 1027
Has anyone here figured out how to get jacoco to ignore inline function coverage? I’m asking here si...
s

Steven Sherry

over 5 years ago
Has anyone here figured out how to get jacoco to ignore inline function coverage? I’m asking here since Arrow uses inline quite a bit (and is the cause of my uncovered inline woes) and I’m sure other people in this channel have run into it. I don’t really care if it’s “scalable”, we just have arbitrary test coverage metrics in our company and I need to massage out the lack of inline function coverage of the report that ends up getting consumed by sonarqube
s
m
+2
  • 4
  • 20
  • 1025
is there a way to get more verbose errors out of the kotlin compiler? When i use `gradlew classes`,...
v

Victor Ng

over 1 year ago
is there a way to get more verbose errors out of the kotlin compiler? When i use
gradlew classes
, I frequently get nothing useful from the compiler>
❯ ./gradlew classes

> Task :kaptGenerateStubsKotlin FAILED
e: Could not load module <Error module>

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kaptGenerateStubsKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to <https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.

BUILD FAILED in 874ms
3 actionable tasks: 1 executed, 2 up-to-date
not kotlin but kotlin colored 0
v
h
r
  • 3
  • 3
  • 1024
Running in to issue with combination it seems of Jetpack Compose 1.7.0-beta and CMP 1.6.10. I'm usi...
j

John O'Reilly

about 1 year ago
Running in to issue with combination it seems of Jetpack Compose 1.7.0-beta and CMP 1.6.10. I'm using
HorizontalPager
in shared compose code and am getting
java.lang.NoSuchMethodError: No static method HorizontalPager...
crash. I have to use that 1.7 bera due in turn to dependency on lifecycle 2.8.. I also tried 1.6.20-dev1663 but still get same issue
j
a
+2
  • 4
  • 6
  • 1023
Previous353637Next

kotlinlang

A modern programming language that makes developers happier.

Powered by