Category "kotlin"

it seems that redisson distributed lock does not work

I'm testing whether distributed lock of redisson does work correctly, with kotlin and coroutine. runBlocking { repeat(1000) { launch {

How to modify the parameter pass to kotlin data class?

Say I have a data class data class MyClass(val crop: Rect, val name: String) But I want to make a copy of the Rect passed in since I don't want the value to be

How to invalidate apollo android cache?

Here is my apollo client code for caching val apolloSqlHelper = ApolloSqlHelper.create(context,"my_app") val sqlNormalizedCacheFactory = SqlNormalized

Flutter run takes too much time after editing MainActivity.kt

I was running some flutter project from github but the runnig taking too much time and showing some cryptic things in console like, lib\main.dart:1 √ Bui

gradle multiple repositories doesn't work

repositories { maven { url "https://maven.aliyun.com/repository/gradle-plugin" } gradlePluginPortal() } error: > Could not resolve all files for c

Intellij disable new line before annotated field for Kotlin

IntelliJ autoformat keeps adding a blank lines between class field declarations having annotations. Do you know how to disable it? This happens for kotlin files

Spring native query with GROUP BY and ORDER BY also pagination

What if I have my native query (with PostgreSQL) in a more "complex" way, which I need to GROUP the data in order to apply an ORDER BY clause? Well, doing so wi

Compose DslPart for complex json

Please could someone assist me create a dslPart object for the below json. I'm stuck at the components array within the content object for type: Component 2. I'

Make test task for kotlin incremental in Gradle?

I would like to make my test task incremental, but I noticed that it looks for files in java instead of kotlin: Task ':test' is not up-to-date because: Task.u

android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify

After upgrading to android 12, the application is not compiling. It shows "Manifest merger failed with multiple errors, see logs" Error showing in Merged mani

Retrieving a plain text error message from a call response

I am building out the login form for a client, and their backend, upon successfully authenticating the user, returns the user validation data in a JSONObject as

How to replace string characters that are not in a reference list in kotlin

I have a reference string on which the allowed characters are listed. Then I also have input strings, from which not allowed characters should be replaced with

Java Socket.IO-client SEVERE: Task threw exception

I try to connect to Web Socket server by using Socket.IO-client Java First i tried this config: fun createSocket(): Socket { val options = IO.Options()

Error uploading Multipart to MongoDB using Ktor

I'm trying to upload a JPEG to MongoDB using Ktor and Kotlin but keep getting an error: java.io.FileNotFoundException: /document/image:32: open failed: ENOENT (

Unable to set BottomSheetDialog initial height

I'm trying to set a height peek from which the dialog must start, then the user if dragged should be able to expand it, the issue is that in any case the bottom

unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)

I received this build error having updated my native android project to Android S (Pre release of android 12). Googling for the error threw up no valuable hits.

Android facebook share opens web page instead of native app

I am using Facebook share SDK and I read the docs which says that if the native Facebook app is installed then it will be used as a share dialog otherwise a web

Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView in Kotlin

Dear team I am trying to use com.google.android.material.bottomnavigation.BottomNavigationView on my Kotlin application. While running the application, My appli

I am getting this issue, I tried using kotlin coroutines and Async still getting the same Calling this from Your main thread can lead to deadlock,

I also made another class that implements runnable to make a new thread still it's now working, Also tried with Aynctask. At last, I made a view model but still

how to flatten more than 2 array nested

I'm a newbie at Kotlin. And when I learn about flatten function Returns a single list of all elements from all arrays in the given array. It is description of