Questions related to Kotlin Android Extensions
Questions tagged [kotlin-android-extensions]
721 questions
7
votes
1 answer
Java to Kotlin converter and nullable method arguments
I had a case in which Java to Kotlin converter failed me miserably by not marking method arguments as nullable.
Example: tracking activity lifecycle using registerActivityLifecycleCallbacks:
registerActivityLifecycleCallbacks(new…

diman
- 429
- 3
- 15
7
votes
1 answer
getting retrofit exception Method return type must not include a type variable or wildcard in kotlin
networkCall = NetworkCall(context)
val responceCall = networkCall!!.getRetrofit(true).callReadMeService()
responceCall.clone().enqueue(object : Callback?> {
override fun onResponse(call:…

pkgrover
- 305
- 3
- 9
7
votes
3 answers
Kotlin's synthetic properties conflict
I'm new to Kotlin. Among other very interesting things, I've found the Android extensions which, according to the documentation, should let me use activities' views without the need of findViewById.
Actually it works very well by adding just this…

Massimo
- 3,436
- 4
- 40
- 68
7
votes
2 answers
Problems trying to generate Kotlin application with Android Studio
-Android Studio 1.5.1, Java 1.7.0 amd64, Ubuntu 15.10
-instaled kotlin-plugin 1.0.0
-created new project with empty activity (API level 15)
-Tools->Kotlin->Configure Kotlin in project
-Default options are selected, All modules, Kotlin plugin…

jjvr
- 85
- 1
- 7
6
votes
3 answers
compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0
I am rebuilding my android project which is in java and some classes are written in kotlin. I have search on google but my problem didn't solve. I am getting below error while building my…

D.J
- 1,439
- 1
- 12
- 23
6
votes
2 answers
Room DB: Duplicate class issues with Dao and RoomDatabase classes
I have a simple Room implementation in my app and am having issues with the Dao and RoomDatabase classes upon building the app (Build is failing).
Dao class is 'NoteDao'
@Dao
interface NoteDao {
@Query("SELECT * FROM notes")
suspend fun…

krtkush
- 1,378
- 4
- 23
- 46
6
votes
3 answers
registerForActivityResult not working when second activity orientation changes
I am calling activity B from activity A using the ActivityResultLauncher and setting the result from activity B when the task is done. This works perfectly if orientation is not changed. The problem is when I change orientation from activity B and…

Anju
- 9,379
- 14
- 55
- 94
6
votes
0 answers
kotlin - prevent lambda from capturing a view accessed using kotlin synthetics
I use the Kotlin Android Extensions plugin for accessing views from XML. If I understand that properly, the synthetic properties generated for the views are nullable, to be more precise - their type is View!, meaning that they can be treated as…

František Hlinka
- 100
- 7
6
votes
1 answer
Knowing all status of a Job with Kotlin coroutines
Is it possible to know all the status of a coroutine Job ?
I find this function extension but I can't access to all the status of a Job :
fun Job.status(): String = when {
isCancelled -> "cancelled"
isActive -> "Active"
isCompleted ->…

Jéwôm'
- 3,753
- 5
- 40
- 73
6
votes
2 answers
Dagger 2: multi-module project, inject dependency but get "lateinit property repository has not been initialize" error at runtime
Dagger version is 2.25.2.
I have two Android project modules: core module & app module.
In core module, I defined for dagger CoreComponent ,
In app module I have AppComponent for dagger.
CoreComponet in core project module:
@Component(modules =…

Leem
- 17,220
- 36
- 109
- 159
6
votes
6 answers
How to combine two different length lists in kotlin?
I want to combine two different length lists. For example;
val list1 = listOf(1,2,3,4,5)
val list2 = listOf("a","b","c")
I want to result like this
(1,"a",2,"b",3,"c",4,5)
Is there any suggestion?

Bahadır Bulduk
- 88
- 1
- 1
- 5
6
votes
1 answer
Kotlin Android Extensions does not work in a library type module
I'm trying to implement kotlin android extensions to use the @Parcelize annotation, if I implement it in the application's module ('com.android.application') it works without problems, but when I try to use it in a library-type module…

Juanes30
- 2,398
- 2
- 24
- 38
6
votes
0 answers
getThreadHandler method is unaccessible from a HandlerThread instance
I am viewing the source code for the HandlerThread class and noticed the class contains a data member mHandler. mHandler is an instance of type Handler.
private @Nullable Handler mHandler;
There is an accessor method for getting the instance of the…
user6820088
6
votes
1 answer
Is it possible to suspendCoroutine in a "by lazy" initializer? I get errors of "runBlocking is not allowed in Android main looper thread"
I've got much of my app working fine with "by lazy" initializers because everything magically happens in the order that is necessary.
But not all of the initializers are synchronous. Some of them are wrapping callbacks, which means I need to wait…

Benjamin H
- 5,164
- 6
- 34
- 42
6
votes
1 answer
java.lang.NoClassDefFoundError when using Kotlin AAR in Android Java application
I have to make a library(aar) in Kotlin and have to use that in Android application made using Java. Kotlin library has a class with companion functions to use statically in Java application. When I use that static method in my Android application…

MaheshGupta
- 143
- 3
- 12