Category "kotlin"

How to overcome "same JVM signature" error when implementing a Java interface?

With the code below, I am getting the following error in IntelliJ IDEA 13.1.6 and Kotlin plugin 0.11.91.AndroidStudio.3: Platform declaration clash: The follow

Kotlin could not find the required JDK tools in the Java installation

When running ./gradlew clean build I get following message: > Task :compileKotlin FAILED FAILURE: Build failed with an exception. * What went wrong: Execu

Android Studio live preview requires project rebuild

I decided to make an application on jetpack compose but when I download the Android Studio canary version 2021.1.1.1 and I try to write some code to see the cha

How to combine multiple mp4 videos into one video using jcodec in Java?

I have multiple mp4 files which are parts of a whole mp4 file. They have been just split up to smaller files. I want to combine those files programmatically int

BottomNavigationView's menu not selected after navigating to other fragment, switching to other menu, and switching back to initial menu

I'm building an android application with 3 menus using bottom navigation. I created new project in Android Studio using Bottom Navigation Activity. I renamed th

"No main manifest attribute" when creating Kotlin jar using IntelliJ IDEA

When creating a jar from my Kotlin code and running it, it says "No main manifest attribute". When looking at the manifest.mf, it has this content: Manifest-Ve

"Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16"

I am a beginner in Kotlin App Development. The following error is occurred when I tried to build the app - e: C:/Users/Lenovo/.gradle/caches/transforms-2/files

Antivirus warning in kotlin-util-io-1.6.21

I'm learning Kotlin and Spring Boot and recently am running into an antivirus warning about a file called oneeva.a!ml while building my project and gradle downl

Room Dao LiveData as return type causing compile time error

I am using Room and implemented Dao that returns LiveData. It was working fine with below dependency added. implementation "androidx.room:room-runtime:2.1.0-al

Kotlin's Arrow Either<Exception, X> and transactions

I am trialing the use of Kotlin's Arrow library Either object to handle exceptions within a project. My experience with it thus far has been OK, but I'm struggl

How to use Jackson JsonSubTypes annotation in Kotlin

I'm trying to convert some Java code that uses Jackson's @JsonSubTypes annotation to manage polymorphism. Here is the working Java code: @JsonTypeInfo( us

java.lang.IllegalStateException when using State in Android Jetpack Compose

I have ViewModel with Kotlin sealed class to provide different states for UI. Also, I use androidx.compose.runtime.State object to notify UI about changes in st

List clear and addAll in single statement Kotlin

Is there any method in kotlin which replaces below two line into one. I know i can create a extension function but I'm eager to know if it already exist in kotl

AAPT: error: 'techport' is incompatible with attribute layout_constraintStart_toEndOf (attr) reference|enum [parent=0]

hello everyone, i'm new to programming. I was doing the layout and when starting the emulator I got this error D:\SkyScanner\app\src\main\res\layout\fragment_m

CoroutineExceptionHandler not executed when provided as launch context

When I run this: fun f() = runBlocking { val eh = CoroutineExceptionHandler { _, e -> trace("exception handler: $e") } val j1 = launch(eh) {

JCenter deprecation; impact on Gradle and Android

Should I be worried about JCenter being deprecated? Why should I migrate my libraries from JCenter to other Maven repositories? Can I continue to use jcenter()

How to wait for khttp (kotlin) response in Android

I've been trying to use khttp to send an .jpg file in an android activity but haven't been able to make it work. fun sendImage(view: View) { try {

Kotlin-Android First App Unresolved Reference TextView Button etc

I'm new to Android & Kotlin development. I wanted to get started with a simple "Hello World", but am already running into problems. I added a Textview to

how to make thumbnail image with initials two char from name android?

I want to thumbnail initials with two word for my image view like "Peter Parker" but am able to get only one word "P"while running code how can get second word

MutableLiveData: Cannot invoke setValue on a background thread from Coroutine

I'm trying to trigger an update on LiveData from a coroutine: object AddressList: MutableLiveData<List<Address>>() fun getAddressesLiveData(): Live