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
  • a

    aoriani

    02/07/2018, 7:37 PM
    What will be the relation between Android KTX and Anko ? Will they complement each other, or am I missing something and they will have different goals inside the Android platform ?
    m
    o
    • 3
    • 3
  • d

    dgngulcan

    02/07/2018, 7:37 PM
    Hey guys, I am having an issue with my kotlin library project. when I export the project as
    aar
    and compile it to a project that kotlin is not added to and having the exception
    Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Lambda"
    What could be the problem?
    • 1
    • 2
  • b

    bill1550

    02/07/2018, 8:13 PM
    Then Log.d("tag", "${activityNullable.getClazz()}) should work
    👍 1
    d
    • 2
    • 1
  • a

    Abhi

    02/07/2018, 10:04 PM
    question about nullable types - as an example, let's say I have a util method in java with signature:
    public static void showDialog(@NonNull FragmentActivity activity)
    and I call it within a fragment using kotlin as
    Util.showDialog(fragment.activity)
    . The compiler complains that
    Expected: FragmentActivity, Found: FragmentActivity?
    Knowing that the activity will not be null when I call the method (i:e I call it right after
    onActivityCreated()
    ), which of the following would be a good way to handle the error: - casting:
    fragment.activity as FragmentActivity
    - non null assertion:
    fragment.activity!!
    -
    let/if
    blocks (but this will hide the exception and hurt me in the long run)
    l
    • 2
    • 2
  • m

    mathew

    02/08/2018, 6:48 AM
    I have a string which holds a json response. How Can I convert or cast it into JsonObject in Kotlin? var string : String = "{\n" + " \"success\": true,\n" + " \"response\": {\n" + " \"message\": \"Login is valid.\"\n" + " }\n" + "}"
    d
    e
    +2
    • 5
    • 7
  • m

    Modou

    02/08/2018, 12:43 PM
    hello I'm a new member in this group.I do J2E and android with java.I want to know how to become a good developer of Kotlin ?
    l
    • 2
    • 2
  • g

    Greg Stepniewski

    02/08/2018, 1:12 PM
    does anyone recommend a logging library? is there anything kotlin-specific or should I just use timber ?
    m
    j
    • 3
    • 2
  • w

    withoutclass

    02/08/2018, 2:52 PM
    if only https://github.com/square/moshi/issues/309 was fixed
    l
    • 2
    • 2
  • j

    juan.hurtado

    02/08/2018, 3:59 PM
    Has anybody noticed a
    Error:(67, 25) Unresolved reference: context
    while using kotlin and databinding ?
    • 1
    • 3
  • m

    Mags

    02/08/2018, 8:24 PM
    Couldn't find anything about this on the web but does anyone use Travis CI to build their apps? Trying to figure out how the support for Kotlin on Travis is
    a
    g
    • 3
    • 6
  • b

    bloder

    02/08/2018, 10:47 PM
    I don't like to use fragments because of its lifecycle, I already had many problems with it
    s
    • 2
    • 1
  • y

    YMobile

    02/09/2018, 8:40 AM
    Yes, I have cleared and rebuilt it
    m
    • 2
    • 5
  • y

    YMobile

    02/09/2018, 4:36 PM
    I give App class name to android:name, but it is not working
    b
    j
    v
    • 4
    • 12
  • j

    Joe

    02/09/2018, 7:10 PM
    I’ve trying to ensure that all traffic goes over a particular network. The problem is that for some reason
    setProcessDefaultNetwork(...)
    is missing. Am I missing an SDK or something? I’m thinking this may be a Kotlin issue, but I’m not sure.
    if (isEnabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        connectivityManager.bindProcessToNetwork(network)
    } else {
        connectivityManager.setProcessDefaultNetwork(network)
    }
    :stackoverflow: 1
    ➕ 1
    d
    • 2
    • 1
  • d

    dave08

    02/11/2018, 5:08 PM
    Anybody get
    Started running tests
    Test running failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'
    Empty test suite.
    in espresso tests? Maybe I have something wrong here?
    @RunWith(AndroidJUnit4::class)
    class NewWazeTest {
    	@get:Rule
    	val rule = ActivityTestRule<FirstLoginActivity>(FirstLoginActivity::class.java)
    
    	@get:Rule
    	val intentsTestRule = IntentsTestRule<CheckServerActivity>(CheckServerActivity::class.java)
    d
    • 2
    • 2
  • k

    Kylych

    02/11/2018, 5:10 PM
    https://stackoverflow.com/questions/48694449/error-with-room-dao-class-when-using-kotlin-coroutines
    g
    • 2
    • 1
  • p

    Pascal How

    02/11/2018, 11:14 PM
    Hi, has anyone tried to mock extension functions with mockito? Internally extension functions are converted to static methods so mockito cannot mock these. Then there is possibly PowerMock or we can provide an interface where the class that implements it, has a method wrapping the call to the extension function. Any suggestions?
    d
    • 2
    • 2
  • p

    Pascal How

    02/11/2018, 11:53 PM
    Ah ok. So far I have been testing extension functions using assert to verify expected and actual results. However, since on the surface, extensions look like methods of the class being extended, there may be scenarios where you would want a way of mocking that function if that class is being injected as a dependency
    g
    • 2
    • 22
  • j

    jw

    02/12/2018, 2:20 PM
    that's a very apt comparison in this case seeing as all of the core libraries for iOS are written in Objective C and have no sign of going away any time soon
    r
    • 2
    • 1
  • j

    Jeremy Rempel

    02/12/2018, 2:23 PM
    I don't think/hope Java is not going away anytime soon. Java is a strength not a weakness
    r
    l
    • 3
    • 4
  • d

    dknapp

    02/12/2018, 2:39 PM
    doh. slowpoke to the ktx questions
    p
    • 2
    • 4
  • v

    viliusk

    02/12/2018, 2:49 PM
    Hey guys, when you use
    kotlin-android-extensions
    , how do you name view IDs
    lowercase_underscored
    or
    camelCased
    ?
    1️⃣ 9
    2️⃣ 10
    d
    • 2
    • 1
  • j

    jw

    02/12/2018, 2:57 PM
    my thoughts are encapsulated here: https://publicobject.com/2016/01/20/strict-naming-conventions-are-a-liability/
    ➕ 1
    👍 4
    m
    r
    • 3
    • 3
  • d

    Daniel

    02/12/2018, 9:53 PM
    A rather serious question regarding android instrumentation testing and kotlin: Is there a way in sight to mock kotlin classes in android ui tests? Using Dexopener and the AllOpen plugin feels.. kind of hacky and not very 'native'.
    d
    • 2
    • 3
  • k

    katz

    02/13/2018, 8:51 AM
    forced to write new app with java... 😭
    😂 2
    😢 7
    😵 1
    :no_red: 4
    l
    e
    +4
    • 7
    • 20
  • b

    bennofs

    02/13/2018, 11:00 PM
    the code I'm using right now is this:
    with(AnkoContext.create(parent.context)) { ...layout... }
    but that doesn't allow me to set layout params for example
    d
    • 2
    • 1
  • m

    maplonki

    02/14/2018, 1:23 AM
    Hello, i am trying to design a basic API module for an android app, i’m having issues trying to design the class relation (trying to use generics) Its there any guide or resource i can use for best practices when doing this kind of stuff? Thanks in advance
    d
    q
    r
    • 4
    • 9
  • k

    kirillrakhman

    02/14/2018, 3:12 PM
    I have used it a couple of times for creating some small views from code, never big layouts
    👍 1
    b
    • 2
    • 1
  • d

    dave08

    02/14/2018, 6:17 PM
    Still getting
    Test running failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'. Empty test suite.
    running espresso tests w/ Multidex on... anybody encountered this...?
    m
    • 2
    • 4
  • w

    withoutclass

    02/14/2018, 8:04 PM
    I actually tried to change the name of it, added it to source files in gradle, and android studio did not seem happy 😛
    s
    • 2
    • 1
Powered by Linen
Title
w

withoutclass

02/14/2018, 8:04 PM
I actually tried to change the name of it, added it to source files in gradle, and android studio did not seem happy 😛
s

sindrenm

02/15/2018, 8:27 AM
That shouldn't be a problem, as long as you configure Gradle to look in there. But alas, it'll still say “java” when looking in your project tree. 😛
💯 1
View count: 2