Category "kotlin"

Is it possible to access internal class with reflection in Kotlin?

Is it possible to access fields of internal class with reflection in Kotlin? I need to change the object of the third-party library's internal class.

Can a Kotlin Object be used as a Spring bean?

Kotlin allows for the definition of singleton objects. In dependency injection (DI) frameworks like Spring or CDI, the life cycle of beans can be defined as sin

not able to use ai.djl.modality.cv.util.BufferedImageUtils in my application

I am new to AI technology .I dded every DJL which are required to my project . But when I go to use ai.djl.modality.cv.util.BufferedImageUtils. I am not able t

Compose's "AndroidView"'s factory method doesn't recall when "remember" value change

I've an AndroidView on my UI and I'm creating a custom view class using factory scope. And I've remember value above my android view which is changing by user a

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.