https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
android
  • g

    g4sarma

    08/27/2018, 10:48 AM
    But i keep getting getTrendingList onFailure Response java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
    l
    m
    +3
    • 6
    • 16
  • z

    zone

    08/27/2018, 2:10 PM
    On line 11 I am getting
    type inference failed not enough information fun<T: Any!> error( exception: Throwable!): Single<T!>!
    Untitled.kt
    d
    d
    • 3
    • 7
  • s

    Seri

    08/28/2018, 6:15 PM
    Just use the internal variable
    itemView
    to refer to the view while making changes
    k
    • 2
    • 2
  • s

    skennedy

    08/28/2018, 11:04 PM
    where did the Context.toast() extension move to? it was https://github.com/android/android-ktx/blob/master/src/main/java/androidx/core/widget/Toast.kt when it was on github, but i cant find it in ktx rc02, though it’s still referenced on https://developer.android.com/reference/kotlin/androidx/core/widget/package-summary#toast
    n
    • 2
    • 1
  • q

    Qracle

    08/28/2018, 11:25 PM
    hi can anyone help me with a kapt gradle issue with dagger?
    m
    • 2
    • 9
  • r

    Ramin

    08/29/2018, 7:56 AM
    now question is how can I run query only and only when I make sure copy operation get completed
    d
    • 2
    • 32
  • g

    Gilles Braun

    08/29/2018, 11:22 AM
    Hey guys I just encountered a weird bug(?) when using
    Map.forEach
    in Android. The reported exception is
    java.lang.NoClassDefFoundError  com.example.packagename.AdManager$executeQueuedCalls$1
    I found the solution on 😒tackoverflow: already, https://stackoverflow.com/a/51215937/7684435 My code looked like this before the fix:
    grouped.forEach { type, interactions -> TODO("placeholder") }
    , and the kotlin compiler chose the
    Map.forEach(BiConsumer<? super K, ? super V> action)
    , which uses
    java.util.function.BiConsumer
    which isn't available on Android < 8 Oreo. Occured with kotlin version 1.2.30, also with 1.2.61, using this gradle config:
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    I am not sure if this would be considered a bug or not
    d
    • 2
    • 3
  • s

    skennedy

    08/29/2018, 5:55 PM
    How do I make this a compile-time error?
    c
    • 2
    • 7
  • j

    Jakub

    08/30/2018, 10:22 AM
    What would you use for a greenfield reactive app: LiveData, RxJava or Coroutines? If you would mix them, which layer would you use which?
    d
    e
    +3
    • 6
    • 7
  • a

    AntoineJojo

    08/30/2018, 3:43 PM
    Hi! Does anyone know how to revoke a permission before a UI test? I use GrantPermissionRule to grant Location permission but once granted it stays granted and I can’t test the case when permission is not granted.
    m
    • 2
    • 6
  • m

    matt tighe

    08/30/2018, 5:11 PM
    sorry that this is slightly off-topic, but can anyone point me in the direction of a resource like this channel for android development that isn’t kotlin-centric?
    l
    u
    • 3
    • 3
  • m

    muralimohan962

    09/01/2018, 8:20 AM
    What's wrong with my code? The recyclerview is not displaying items.
    :stackoverflow: 6
    d
    s
    • 3
    • 6
  • m

    mingkangpan

    09/03/2018, 10:19 AM
    implementation "org.jetbrains.kotlinx:kotlix-coroutines-android:0.22.5-eap13"
    g
    • 2
    • 2
  • m

    mingkangpan

    09/03/2018, 10:19 AM
    ^failed to resolve
    g
    • 2
    • 6
  • m

    mingkangpan

    09/03/2018, 10:33 AM
    damn, now this.... I guess I shouldn't use coroutines with 1.3
    g
    • 2
    • 1
  • m

    mingkangpan

    09/03/2018, 3:26 PM
    now I get some kind of R8 error oO
    builderror.txt
    g
    • 2
    • 3
  • a

    andreasmattsson

    09/04/2018, 12:09 PM
    I just attempted to upgrade my Kotlin Android project to use the "androidx" jetpack libraries rather than the old support libraries, and suddenly all my kotlin-android-extensions synthetic view properties are reporting errors in gradle build:
    Unresolved reference. None of the following candidates is applicable because of receiver type mismatch
    Anyone have any troubleshooting advice?
    l
    r
    • 3
    • 5
  • v

    vsossella

    09/04/2018, 5:33 PM
    https://tech.olx.com/fast-prototypes-with-flutter-kotlin-native-d7ce5cfeb5f1
    c
    • 2
    • 1
  • j

    jw

    09/05/2018, 4:20 PM
    It's Moshi
    😅 2
    😂 7
    s
    e
    • 3
    • 2
  • h

    Hong

    09/05/2018, 4:51 PM
    Since we are talking about Gson here, I have a different question. My data class has member properties that has default values, e.g.
    data class Person(val name: String, val age: Int, val desc: String = "")
    When cloud JSON (via Retrofit and Gson) comes back w/ null value for
    desc
    field, the resultant
    Person
    instance will have null value for
    desc
    field, instead of empty string. So the non-null field
    desc
    can have null value. I searched online for some solutions but they all seem hacky, anyone has any good suggestion?
    👍 1
    m
    g
    z
    • 4
    • 20
  • h

    Hong

    09/05/2018, 4:52 PM
    Thanks Daniele! So just replace Gson w/ Moshi and call it done?
    g
    • 2
    • 1
  • l

    lawlorslaw

    09/06/2018, 1:41 AM
    im trying to set up crashlytics in my project. i went through all the intitialization steps. set up a firebase project, as well as a fabric project. linked the projects. when i go to those dashboards it shows 0 crashes. Im trying to trigger a crash like so
    Crashlytics.logException(IOException())
    Why doesnt this force close the app and why doesnt it show a crash in either console?
    e
    • 2
    • 2
  • l

    lawlorslaw

    09/06/2018, 4:09 AM
    The developer docs (https://firebase.google.com/docs/analytics/android/start/ ) for firebase analytics suggest getting an instance of FirebaseAnalytics in the onCreate() method of an Activity. Is this really the recommended approach or should this be in a Utils class, in the Application class, or somewhere else?
    g
    • 2
    • 1
  • s

    Slackbot

    09/07/2018, 5:27 AM
    This message was deleted.
    g
    l
    • 3
    • 3
  • l

    lawlorslaw

    09/07/2018, 6:19 AM
    I have added the plugin
    apply plugin: 'kotlin-android-extensions'
    , but
    bundleOf()
    doesn’t resolve itself. Is there something else to set up?
    g
    • 2
    • 7
  • q

    Qracle

    09/07/2018, 7:23 AM
    if anyone is kind enough, can someone please check if i properly set up injecting a fragment into an activity with dagger2 ?
    :google: 5
    :stackoverflow: 1
    • 1
    • 1
  • s

    Slackbot

    09/07/2018, 7:33 AM
    This message was deleted.
    😶 1
    👨‍✈️ 3
    👮‍♂️ 6
    👎 9
    🚔 11
    k
    • 2
    • 1
  • c

    Chester

    09/07/2018, 2:16 PM
    Hi there I'm Chester from South Africa in a few months time I'll be presenting at a meetup here in SA, I would just like to ask what functional aspects of Kotlin should I highlight in my talk (The topic is going to be Functional Android)? Thank you
    m
    o
    r
    • 4
    • 7
  • k

    kevin.cianfarini

    09/09/2018, 2:33 AM
    People who have worked with
    ViewPager
    in combination with `RecyclerView`: did you experience weirdness with the fragment lifecycle displaying your list of items?
    :stackoverflow: 3
    j
    u
    • 3
    • 4
  • u

    ubu

    09/10/2018, 10:22 AM
    Hi there. Is it possible to use Kotlin Delegation in Android Application class?
    m
    • 2
    • 1
Powered by Linen
Title
u

ubu

09/10/2018, 10:22 AM
Hi there. Is it possible to use Kotlin Delegation in Android Application class?
m

maxmello

09/10/2018, 10:32 AM
You mean like lazy {…}? I use that frequently inside the application class
View count: 1