https://kotlinlang.org logo
Docs
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
  • d

    david.bilik

    03/21/2017, 11:18 AM
    Is there a way to support logm live template in kotlin? I dont know how to retrieve function attributes when expanding log, I just achieved to retrieve functionName
    👍 1
    l
    • 2
    • 1
  • h

    henrik

    03/23/2017, 1:03 PM
    I am using Parceler which has problems with Kotlin's out variance in List<T> since it can't figure out the type (https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FKT-5792) . One solution to this is to use mutable lists. Is there a solution that does not sacrifice immutability?
    m
    • 2
    • 2
  • s

    s.luhmirins

    03/23/2017, 3:37 PM
    I wonder if there is any iOS developer with android phone as main smartphone?
    t
    • 2
    • 1
  • s

    srayhunter

    03/23/2017, 3:50 PM
    @s.luhmirins I actually use an iphone for my main phone and do a ton of android
    s
    v
    • 3
    • 3
  • h

    henrik

    03/23/2017, 4:02 PM
    @dathoang.se seeing some different, learning what "they do". Seeing other patterns. I would recommend everyone to try developing for the other platform
    v
    • 2
    • 2
  • k

    krokyze

    03/24/2017, 9:49 AM
    What’s the problem here?
    k
    m
    • 3
    • 3
  • m

    mg6maciej

    03/24/2017, 11:12 AM
    Exclude kotlin from that dependency like here (support lib): https://github.com/mg6maciej/fluffy-octo-rotary-phone/blob/develop/app/build.gradle#L79 Or force version of Kotlin: https://github.com/mg6maciej/fluffy-octo-rotary-phone/blob/develop/build.gradle#L27-L34
    a
    • 2
    • 2
  • a

    aaverin

    03/24/2017, 11:50 AM
    Ok, I can confirm that rolling back to 1.1.0 solves unit test problems
    a
    • 2
    • 1
  • r

    ralf

    03/24/2017, 12:39 PM
    The issue you’re seeing is probably the same as https://youtrack.jetbrains.com/issue/KT-16897
    👍 2
    a
    • 2
    • 3
  • j

    juliocbcotta

    03/24/2017, 4:41 PM
    Trevor, I don`t know if I got it right but.... What I meant was something like ...
    @Module(subcomponents = ComponentA.class)
    public class ActivityAModule
    @Inject
    ActivityA activity;
    
    @Provides
    @ActivityScope
    public providePresenter()
    {
    return new PresenterA( (View) activity);
    }
    
     @Binds
        @IntoMap
        @ActivityKey(ActivityA.class)
        abstract AndroidInjector.Factory<? extends Activity> bindActivityInjectorFactory(MainComponent.Builder builder);
    The modules that don`t need the Activity.. would not need to have the instance..
    t
    • 2
    • 10
  • d

    david.bilik

    03/25/2017, 3:53 PM
    JvmField
    is for static variables
    a
    • 2
    • 1
  • a

    anthonyeef

    03/25/2017, 3:54 PM
    thx bro, save my day
    • 1
    • 1
  • m

    miha-x64

    03/27/2017, 11:17 AM
    @mg6maciej why they are heavyweight? I wonder because I have 13 Gradle modules in my Android project 😱
    m
    d
    +3
    • 6
    • 42
  • j

    jmfayard

    03/27/2017, 12:24 PM
    Hello, any good samples android app you could recommend me to refresh my android knowledge ? I have done android programming two years ago, I have learned and used since kotlin, rx, and patterns like redux, testing robots, ... but I didn't practice those things in an android context yet, so I would love to have an existing codebase to connect the dots
    l
    • 2
    • 2
  • l

    louiscad

    03/28/2017, 2:18 PM
    I also experienced a debugger bug while in Android app where I could do step by step, line by line, but could not see the local variables not access them (didn't try with non local variables though). Hopefully, I could find my bug
    d
    • 2
    • 2
  • b

    brianwernick

    03/28/2017, 3:53 PM
    That looks fine to me (as a note, you don’t need
    mavenCentral()
    as
    jcenter()
    is a superset of maven central)
    m
    t
    • 3
    • 5
  • b

    brianwernick

    03/29/2017, 3:41 PM
    ^ That’s just Instant run in general though, not anything specific to Kotlin 😉
    r
    • 2
    • 1
  • m

    miha-x64

    04/02/2017, 6:27 PM
    So many VerifyError bugs in :youtrack: ... With 1.1.2-eap-44 I'm getting java.lang.VerifyError: Verifier rejected class SomeClass: ReturnType method(Parameter) failed to verify: SomeClass method(parameter): [0x22] returning 'Reference: java.lang.Object', but expected from declaration 'Precise Reference: ReturnType' (declaration of 'SomeClass' appears in /data/app/package-1/base.apk) Anyone else?
    k
    • 2
    • 4
  • u

    uli

    04/02/2017, 6:48 PM
    I don't quite get the question. But i do have another hint... Regarding your board model. If you store the board model into a local call, the compiler can probably infer nullability and you can get rid of all the !!
    o
    t
    • 3
    • 3
  • d

    dalexander

    04/03/2017, 1:29 PM
    import kotlinx.android.synthetic.main.some_layout.view.*
    
    //class defined here, custom view, which extends FrameLayout
    
    init {
        val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
        inflater.inflate(R.layout.some_layout, this, true)
    }
    Note the debugger seems to be confused about what's actually imported, but the code works.
    d
    • 2
    • 4
  • b

    btilbrook-nextfaze

    04/03/2017, 11:07 PM
    Does anybody have any suggestions for a POJO cache with TTL/expiry for use on Android? Specifically I’m hoping to avoid resorting to importing Guava, due to its size.
    m
    • 2
    • 1
  • j

    jonnothebonno

    04/04/2017, 11:59 AM
    Hey guys is this an appropriate place to ask about potential issues with Kotlin on Android? 🤔 - I have a really bizzar issue that might be being caused by me but anyways… I’ve created a simple event dispatcher that’s lazy initialised like so
    companion object {
            val instance by lazy { EventDispatcher() }
        }
    and whenever I add anything to it and try to dispatch an event, I receive the following error
    java.lang.NoClassDefFoundError: jonnothebonno.me.app.notifications.events.EventDispatcher$dispatchEvent$1
    The weird thing is, this only appears to happen on older mobiles. Works perfect on my pixel but crashes on my nexus 5. I’m using
    Kotlin 1.1.1
    and
    gradle 2.3.0
    l
    • 2
    • 12
  • j

    jonnothebonno

    04/04/2017, 3:22 PM
    @louiscad pointed out the issue, forgot to put parenthesis around my lambda parameters 😞 Thanks dude!
    😉 1
    l
    • 2
    • 1
  • j

    johannes.lagos

    04/06/2017, 8:31 AM
    Hi guys. I'm wondering which DI I will use in my next project. I know many prefer Dagger, but if you could choice a second time, what have you picked then?
    d
    • 2
    • 1
  • c

    curioustechizen

    04/06/2017, 8:53 AM
    @nhaarman @bulwinkel How then do you propagate dependencies through the layers without the intermediate layers having to simply forward dependencies to the lower layers?
    n
    b
    • 3
    • 16
  • r

    rwachol

    04/06/2017, 11:54 AM
    I’d avoid dagger with kotlin 😉
    a
    • 2
    • 4
  • r

    rwachol

    04/06/2017, 12:25 PM
    I think you should set constatnt ID for notification and put extras to it (as your database id entity)
    z
    • 2
    • 3
  • p

    Paul Woitaschek

    04/06/2017, 2:28 PM
    @georgeci That doesn’t work in andorid tests
    d
    • 2
    • 2
  • m

    michaelsims

    04/06/2017, 3:52 PM
    @Paul Woitaschek Have you tried the
    kotlin-allopen
    plugin?
    p
    g
    s
    • 4
    • 6
  • d

    dionsegijn

    04/06/2017, 6:03 PM
    Mockito 2.1.0 makes it possible to mock final classes and thus use it for Kotlin, just follow their instructions here: https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#mock-the-unmockable-opt-in-mocking-of-final-classesmethods @Paul Woitaschek you might have forgotton to add
    mock-maker-inline
    ?
    p
    • 2
    • 1
Powered by Linen
Title
d

dionsegijn

04/06/2017, 6:03 PM
Mockito 2.1.0 makes it possible to mock final classes and thus use it for Kotlin, just follow their instructions here: https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#mock-the-unmockable-opt-in-mocking-of-final-classesmethods @Paul Woitaschek you might have forgotton to add
mock-maker-inline
?
p

Paul Woitaschek

04/06/2017, 8:40 PM
dionsegijn: not working for Android tests
View count: 7