Category "kotlin"

Property must be initialized or be abstract

How to declare class field? Like we can have it in java: protected SharedPreferences mSharedPreferences; And later in onCreate(): mSharedPreferences = Preferen

MapStruct not autowiring with Kotlin and Spring Boot, built using Gradle

I have the following parts in my gradle file: apply plugin: 'kotlin-kapt' ... compile("org.mapstruct:mapstruct:1.3.0.Final") kapt("org.mapstruct:mapstr

IllegalStateException: Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first

I've been getting this fatal error today after changing some gradle dependences. Even though I tried to revert the gradle dependences back to the original I'm s

SetChecked() does not work

Hey guys on my Adapter ViewHolder.bind I have to check if some value is true, then check my checkbox. The problem is I cant use setCheck(tru) cause in kotlin do

Activity result contracts with Ucrop: cannot get crop result into app

I have an activity that is supposed to get an image from gallery and preview it before allowing the user to upload it to a database. I am using UCrop as my imag

How to use lombok with Kapt3

When I try to run Java/Kotlin android application with Lombok while using Kapt3: apply plugin: 'kotlin-kapt' javac compilation fails with numerous error: ca

Error:Execution failed for task ':app:kaptDebugKotlin'

I'm new to using Kotlin and trying to set it up with Dagger2, I've seen some few examples but none of them seem to work for me. I keep getting this Error:

Is there an elegant way to save and restore View state in Kotlin?

Writting custom views that keep their state across configuration changes in Android is verbose, look at the amount of boilerplate code for saving the state of

How to show error message in OutlinedTextField in Jetpack Compose

I need to show error message in OutlinedTextField and I don't find any documentation about how to do it. I found several ways in tutorials, for example to creat

How to show error message in OutlinedTextField in Jetpack Compose

I need to show error message in OutlinedTextField and I don't find any documentation about how to do it. I found several ways in tutorials, for example to creat

Is it possible in one Java file to mix Java code and Kotlin code

Android Studio 3.4.2 in build.gradle: buildscript { ext.kotlin_version = '1.3.41' repositories { google() jcenter() } d

Can´t put the background in white on jetpack compose

I'm making a Login page on Jetpack compose. I'm using themes with MaterialTheme. When I choose the background colour as white, it shows me a dark grey colour. I

MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent

I'm trying to update my application to Android SDK 31 but I'm having an issue with MediaSessionCompat. I have a MediaService that extends the MediaBrowserServic

Firestore Delete elements from a nested map kotlin

I have a collection, I want to delete 2 documents from this collection Paradas collection and delete it from the nested map too Nested map like in SQL, when yo

Is there any way to implement pagination in spring webflux and spring data reactive

I'm trying to understand reactive part of spring 5. I have created simple rest endpoint for finding all entities using spring web-flux and spring data reactive

Check if Android app is running on a Google test device?

I recently uploaded an app bundle to Internal App Sharing, and was surprised to see that on my backend, there were 7 new users of this new app version just a fe

kotlin kapt3 KaptBaseError: Error while annotation processing ::For Room Database

I am running into this strange issue in the Room database operation classes. There are lot of Annotations are used, starting from Database then Entity, DAO... N

Strange value comparison issue in Kotlin, "===" returns true but "==" returns false

I have encountered a very strange value comparison issue in Kotlin that I cannot explain, the following code prints false data class Foo ( val a: Byte ) fun

How to pass command line argument to Gradle Kotlin DSL

Here's an example from Groovy that represents exactly what I would like to achieve: Command line: ./gradlew jib -PmyArg=hello build.gradle.kts task myTask

Kotling :: Android :: java.lang.ClassCastException: java.lang.Class cannot be cast to androidx.lifecycle.ViewModel

I am getting an exception in the first line of the code below viewModel.homeLiveData.observe(this, Observer { list -> list?.let { mLis