Category "kotlin"

UninitializedPropertyAccessException in Android Studio using Kotlin

I am a beginner making use of a Roomdatabase. Mostly using it to load in and pass items between tables using simple relationships. package com.example.allin

Room database onConflict = OnConflictStrategy.REPLACE not working

I am working on Room database and trying to insert list of items(eg. list of Quotes which contains author name and a quote in my case). Following is the code I

How to pause a video in inside the webview in android

I am doing a task where i have to load the url inside the webview so that i can show the video,everything is works fine but the thing is i need to pause the vi

Gradle problems of adding koin test dependencies

I'm a beginner with gradle and would like to use koin in my Kotlin project. However, I get the following error Execution failed for task ':compileTestKotlin'. &

kotlin const val Const 'val' are only allowed on top level or in objects

In my Kotlin project I want to declare constant on compile time: So I use this: @RunWith(AndroidJUnit4::class) class TradersActivityTest { private latein

Is there a way to use the default value on a non-optional parameter when null is passed?

For example, if I have the following data class: data class Data( val name: String = "", val number: Long = 0 ) And functions that can return null:

Cause: androidx.navigation.safeargs can only be used with an androidx project

I am facing issue with navigation component called safeargs. I have used classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0' in build grad

Correctly implementing wait and notify in Kotlin

According to this document, using wait and notify is discouraged in Kotlin: https://kotlinlang.org/docs/reference/java-interop.html wait()/notify() Eff

IntelliJ Error:Kotlin: Module was compiled

I have used IntelliJ IDE just for Spring Boot project. Strong NOTE that I have not used any Kotlin project. But, today, I have an error below. Any professional

android studio cannot resolve symbol 'GradleException'

Creating new Android Studio project get the following exception in Gradle build file: Cannot resolve symbol 'GradleException' Gradle still builds successfu

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