Questions tagged [kotlin]
Kotlin is a cross-platform, statically typed, general-purpose high-level programming language with type inference. This tag is often used alongside additional tags for the different targets (JVM, JavaScript, native, etc.) and libraries/frameworks (Android, Spring, etc.) used by Kotlin developers, if the question relates specifically to those topics.
kotlin
35,643
questions with no upvoted or accepted answers
32
votes
1
answer
16k
views
error: incompatible types: NonExistentClass cannot be converted to Annotation @error.NonExistentClass()
I am trying to generate Doka docs of my project. While generating I am getting an error like above. I have searched so many but could not able to get solution to this. I have gone through this link ...
29
votes
1
answer
2k
views
Attach sources to kotlin library project don't show up in AS
I want to attach the sources to an kotlin library project and it looks I succeeded as I have the source-jars now in here:
https://jitpack.io/com/github/walleth/kethereum/bip44/0.21/
the version ...
26
votes
1
answer
542
views
Streaming Audio in FLAC or AMR_WB to the Google Speech API
I need to run the google speech api in somewhat low bandwidth environments.
Based on reading about best practices, it seems my best bet is to use the AMR_WB format.
However, the following code ...
25
votes
1
answer
2k
views
Is there anyway we can create flavored versions of Kotlin Multiplatform build files like dev and prod?
I have a requirement where I want to have different set of data to be shipped with the library generated by kotlin multiplatform module for different flavors like dev and prod.
In an Android project, ...
24
votes
1
answer
3k
views
Can I load resources from a Kotlin common module (multiplatform project)
I am porting a maven JVM Kotlin project to a gradle multiplatform Kotlin project. After creating the default Kotlin multiplatform project from Intellij IDEA, I notice there is a resources directory, ...
21
votes
1
answer
419
views
Kotlin compatibility with JavaFXPorts
I would like to build a JavaFX Android app with JavaFXPorts and Kotlin code. Is it possible to use Kotlin in a JavaFXPorts project? Here's my example Gradle (version 5.6.4) project:
Note: Problem ...
20
votes
0
answers
890
views
An exception occurs during Evaluate Expression Action :
I'm developing an application using kotlin on Android Studio and it gives me below error while trying to debug an object. I guess it only occurs while working with the old devices like samsung s3 ...
19
votes
2
answers
568
views
How do I reference a secondary constructor in KDoc?
I have a Kotlin class with a secondary constructor, that is supposed to be used in a certain scenario. Now this should be properly documented from the first constructor so you can see it right away.
/...
18
votes
0
answers
2k
views
Correct way to retrigger loadTokens in Ktor client
In my mobile app, I have a singleton Ktor HttpClient with bearer authentication configured as such:
HttpClient(…) {
install(Auth) {
bearer {
sendWithoutRequest { requestBuilder ...
18
votes
1
answer
2k
views
Debug kotlin sources
I'm working in Kotlin since severals months, I started to make libraries like i was doing with java sources, and it's working fine. But, i have a huge problem with these librairies, I cannot debug ...
17
votes
1
answer
498
views
Debugger breakpoint hitting on the same line in file but of the different build variant while using lambdas
We have many different builds, flavors and dimensions in our project. But after updating to Android Studio 3.5 we noticed a strange behavior that when we create a breakpoint in some lambda of our file ...
17
votes
3
answers
1k
views
Room database with Kotlin inline class as an Entity field
I am trying to get Room(https://developer.android.com/topic/libraries/architecture/room) work with Kotlin's inline classes as described in Jake Whartons article Inline Classes Make Great Database IDs:
...
16
votes
0
answers
870
views
How to avoid prop drilling in Jetpack Compose
I'll try to describe the problem with a short example.
Lets assume we have a child composable representing a custom switch, and we want to keep it immutable, so we need to pass the initial state and ...
16
votes
1
answer
2k
views
Clear `PagingDataAdapter` between refresh calls
I am using the Paging 3 PagingDataAdapter to search the database based on the given query.
Every time a new query is submitted, i call the refresh() method on the adapter. The problem is that until ...
16
votes
0
answers
3k
views
android.os.Parcel.createExceptionOrNull Fatal Exception: java.lang.IllegalArgumentException
I am getting this exception on android 11 Samsung device.
This is the stack trace:
at android.os.Parcel.createExceptionOrNull(Parcel.java:2389)
at android.os.Parcel.createException(...