Questions related to Kotlin Android Extensions
Questions tagged [kotlin-android-extensions]
721 questions
28
votes
3 answers
Can I use third party java libraries(.jar) for Android development with Kotlin?
I haven't moved to Kotlin for Android development yet, just wondering if Kotlin supports the available third party libraries for Android as is or they need to be updated in order to work with Kotlin?

Amit
- 3,422
- 3
- 28
- 39
27
votes
5 answers
Extremely slow in autocompletion & code analysis for Kotlin projects in Intellij IDEA
We have a project on IDEA that consists of a couple med sized Java packages and one very small Kotlin package (5 files). I noticed performance is fine with any Java packages, but it's 10x slower in autocompletion, code analysis and compilation for…

Kelvin
- 703
- 1
- 10
- 13
26
votes
5 answers
disable kotlin-android-extensions deprecation warning
My project's migration to View Binding is underway but in the meantime this warning is distracting when looking at build logs
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide…

kassim
- 3,880
- 3
- 26
- 27
26
votes
3 answers
Coroutines and Retrofit, best way to handle Errors
After reading this issue How to deal with exception and this Medium Android Networking in 2019 — Retrofit with Kotlin’s Coroutines I've created my solution which consist in a BaseService capable of making the retrofit call and forward the results…

GuilhE
- 11,591
- 16
- 75
- 116
26
votes
4 answers
Program type already present: org.intellij.lang.annotations.Flow
I am getting this error whenever I try to run a program in Kotlin. My gradle files are like this: Project Level Gradle
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
}
dependencies {
…

theanilpaudel
- 3,348
- 8
- 39
- 67
25
votes
3 answers
Navigation Library inflator throws ClassNotFoundException for data class
In the Navigation Library version alpha09+ (using alpha11) I am experiencing a ClassNotFoundException for one of my data classes which I defined as an argType in my navigation graph.
app:argType="com.package.app.data.model.user.User.Full"
This…

Bjarn Bronsveld
- 989
- 8
- 18
25
votes
2 answers
Out-projected type 'ArrayList<*>' prohibits the use of 'public open fun add(index: Int, element: E): Unit defined in java.util.ArrayList'
I have this snippets:
class RecyclerViewAdapter internal constructor(
val clazz: Class,
val layout: Int,
var dataList: MutableList<*>)
...
...
...
fun RecyclerView.getDataList() : ArrayList<*> {
return…

LEMUEL ADANE
- 8,336
- 16
- 58
- 72
24
votes
6 answers
Unable to add Kotlin Android Extensions to my project
When i try to add kotlin-android-extensions via:
apply plugin: 'kotlin-android-extensions'
to my project Android Studio tells me Plugin with 'kotlin-android-extensions not found??
What is going wrong? I am Running Android Studio 3.0 Canary 8

Rik van Velzen
- 1,977
- 1
- 19
- 37
23
votes
9 answers
Android: How to determine Network speed in android programmatically
How to show a slow internet connection to the user when the network is connected
Note: Not a network type (2G,3G,4G, WIFI)

Mind_Control
- 315
- 1
- 2
- 10
23
votes
2 answers
How to disable the generating of synthetic view properties by the Kotlin Android extensions plugin
The Kotlin Android Extensions plugin generates static properties for each view with an ID from my app layout files, as it is described in the documentation.
I would like to disable this feature, because we use DataBinding instead of the Kotlin…

Daniel Zolnai
- 16,487
- 7
- 59
- 71
22
votes
2 answers
@Parcelize in multi-platform project
I'd like to create a class in a multi-platform project, and use Parcelize to make it Parcelable in the Android version.
So in my lib-common project, I tried:
expect annotation class Parcelize()
expect interface Parcelable
@Parcelize
data class…

Cactus
- 27,075
- 9
- 69
- 149
22
votes
3 answers
How can I access a char in string in at specific number?
I tried this code but it is giving me errors. So how can I access a character in a string in kotlin? In java, it can be done by the charAt() method.
private fun abc(x: String) {
var i: Int = 0
while (x[i].toString() != "+") {
var y:…

Aakash Sharma
- 427
- 1
- 6
- 15
21
votes
2 answers
Kotlin Android Extensions giving Layout Null Pointer
There is a fairly simple scenario that is giving me quite a bit of trouble. I'm making a very simple Activity with an embedded fragment. This fragment is simply a Gridview that displays some images. The issue comes when referring to the Gridview…

Josh Ribeiro
- 1,349
- 3
- 18
- 28
21
votes
4 answers
Programmatically inflated layout with Kotlin Android Extensions
I have a following layout:

Krupal Shah
- 8,949
- 11
- 57
- 93
21
votes
2 answers
Kotlin Android Extensions: How to get a reference to a view in a layout that gets included into another layout?
I have a layout that includes another layout:
activity_main.xml:

Lukas Lechner
- 7,881
- 7
- 40
- 53