Category "kotlin"

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.

How to fix ERROR: No signature of method: build_ap86oam3dut3pxce3x49rdtma.android()?

ERROR: No signature of method: build_ap86oam3dut3pxce3x49rdtma.android() is applicable for argument types: (build_ap86oam3dut3pxce3x49rdtma$_run_closure1) value

How to map Elasticsearch Spring Data AggregationsContainer contents to custom model?

I am using Elsaticsearch Spring Data. I have a custom repository that uses ElasticsearchOperations based on examples on docs. I need some aggregation query resu

how to make gpx file in android

I wanna write gpx file with DOM and Transformer My code is like that try { val document = DocumentBuilderFactory.newInstance().newDocumentBuilder().

Can't configure the Android Spellchecker service to simply validate if string is a valid word or not

I am building a Flutter app that requires that I validate if a string is a valid word. The user is not inputting text, he is using elements to build the word. S

detached entity passed to persist - on findByMethod

I understand the error message and i know how to solve it, but i want to know why it occurs in this specific place especially on a find method. I created a mini

In Android Navigation Architecture, how can I check if current Fragment is the last one?

I need to display custom AlertDialog, but only when there are no more fragments after calling NavController.navigateUp(). My current code does something similar

Full screen notifications unwantedly triggering keyguard

I'm making an app that shows full-screen notifications when the device is locked. Expected behavior: when a notification is launched, the activity shows over th

Retrofit call in Kotlin Coroutines viewModelScope

Recently I've updated my ViewModel to use new viewModelScope. From its implementation, I see that Dispatchers.Main.immediate is set as the default CoroutineDisp

Retrofit call in Kotlin Coroutines viewModelScope

Recently I've updated my ViewModel to use new viewModelScope. From its implementation, I see that Dispatchers.Main.immediate is set as the default CoroutineDisp

Data class metadata is removed with proguard / R8 for Kotlin 1.6.0

I have a package with some data classes and I'm trying to access the constructor at runtime using Kotlin reflection clazz.primaryConstructor, Everything is work

Facebook ads for kotlin

i am trying to show facebook ads on my android app written in kotlin but everytime i try to add code it shows errors, i searched everywhere but could not find a

Error while using suspend with DAO methods

I am getting a compilation error that I have described below. I have tried different solution provided on similar question like mine but neither of them worked

java.lang.IllegalStateException: view!!.findViewById(R.id.dog_image) must not be null

I am working with Android Studio and Kotlin. I am trying to create an RecyclerView and a Adapter. I obtain the following error when I try to use the RecyclerVie