Category "kotlin"

How to add/remove characters inside TextField?

I have a Room database with a table that holds users. Each user has an ID and a name. My goal is to change the name of the user based on the ID. Here is what I

Java to Kotlin conversion extending Abstract class

I'm converting a Java class that extends an abstract class as per the code below public class BadRequestAlertException extends AbstractThrowableProblem {

Problems with android Compose

I am trying to work through a tutorial on android compose. It works well while I use:kotlin-gradle-plugin:1.5.31, but the android studio has updated to :kotlin-

In Flutter 3.0, the Qr Code Scanner is giving an error

I am updating an old project. This qr code scanner is giving an error.The project had previously run on flutter 2.10. There are errors in Flutter 3.0. import 'p

How to setup protobuf in kotlin/android studio?

First time using protobuf, so following googles instructions I placed all my .protos in a protos folder in my android studio project. I know the .proto files ar

Spring Boot Kotlin Mockito @MockBean dependency throws IllegalStateException null on method call

I am relatively new to Spring and Kotlin. I ran into this problem and it does not seem that there is a comprehensible (for me) explanation anywhere on the Inter

How to get position in Horizontal RecyclerView?

I'm a Kotlin's student. I'm doing a tutorial layout using RecyclerView horizontal, but I'm having an issue, already tried to find some answer on stack but didn'

Retrofit2 not working when enabling Proguard

I have an application which uses retrofit to fetch logo form an API. When i don't obfuscate and shrink my code, everything works fine. But when i enable it, th

After upgrading gradle to 4.0.0, retrofit do not receive response anymore

After upgrading from gradle 3.6.3 to 4.0.0, retrofit only able to send request but not able to receive response. From the logging I can only see: I/okhttp.OkHtt

Unit test the new Kotlin coroutine StateFlow

Recently, the class StateFlow was introduced as part of Kotlin coroutines. I'm currently trying it and encountered an issue while trying to unit test my ViewMod

Host name may not be empty

After upgrading my Android Studio, I got this error whenever I wanted to generate a signed Apk (without any detail of where the problem is). There was no proble

Unit test the new Kotlin coroutine StateFlow

Recently, the class StateFlow was introduced as part of Kotlin coroutines. I'm currently trying it and encountered an issue while trying to unit test my ViewMod

Android ExoPlayer delay when playing audio

In my app, I'm trying to use ExoPlayer to play audio and video together at the same time using MergingMediaSource. The problem is that it buffers for several mi

Moshi: Parse single object or list of objects (kotlin)

Problem How to parse either a single Warning object or a list of Warning objects (List<Warning>) from an API using Moshi? The response as a single warning

How to implement Pagination with Ktor and Kmongo

Problem: To Implement Pagination on the server side using Ktor and Kmongo. Tech Stacks: Kotlin as Programming Language. Ktor as Web Framework. MongoDb as databa

Flutter Facebook App Events gives the error: kotlin.UninitializedPropertyAccessException: lateinit property appEventsLogger has not been initialized

I am using the latest version of FaceBook App Events plugin in Flutter with the latest version of Flutter as well. On click event, I am calling the logEvent met

Spring Data JPA / Hibernate "Unable to locate Attribute with the given name"

We have a problem with a Spring Web Application and Hibernate. It is written in Kotlin. We have an abstract Entity @Inheritance(strategy = InheritanceType.JOI

Android: Unable to detect vertical plane

I am trying to detect a vertical plane like wall to add image view on a vertical plane. But did not find the vertical plane. As per the default config for a ses

Android Dagger2 ComponentProcessor was unable to process

I'm trying to make multi module project with Dagger2. You can see my code following the link. In the main branch is working solution where all the dagger classe

Room field / getter mismatch warning when using sealed classes or Any

I have a Room (v2.4.0-beta01) database, and whilst it works fine, during the build it gives a field vs getter mismatch warning on a few fields, included below.