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

    alec

    07/04/2020, 12:50 PM
    file a github issue under sql-psi pls
    n
    • 2
    • 3
  • l

    louiscad

    07/07/2020, 6:56 AM
    Hello, I'm using OkHttp (version 4.7.2) in a Gradle plugin project, and I get
    okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
    unless I add logging with
    BODY
    level:
    .addInterceptor(HttpLoggingInterceptor(logger = HttpLoggingInterceptor.Logger.DEFAULT)
                .setLevel(HttpLoggingInterceptor.Level.BODY))
    Whenever I disable body logging, I get the cryptic exception aforementioned, and I don't get why. Where should I look for? I can commit and push my work for reproducing if needed since its open source.
    ✔️ 1
    g
    j
    • 3
    • 9
  • s

    Siggi Gunnarss

    07/08/2020, 11:47 AM
    Hi all. Anyone up for an sqldelight question? I have a multiplatform project that includes a
    linux_x64
    target (the main targets are android and iOS, but I maintain a linux target to run native tests without a mac). The project builds fine if i comment out the linux target. When I include it I get build errors:
    Required org.jetbrains.kotlin.native.target 'linux_x64' but no value provided.
    - Variant 'mingw-api' capability com.squareup.sqldelight:native-driver:1.4.0:
    - Incompatible attribute:
    - Required org.jetbrains.kotlin.native.target 'linux_x64' and found incompatible value 'mingw_x64'
    I can't see in the documentation, is there maybe no support for linux native in SqlDelight?
    • 1
    • 1
  • s

    Sam

    07/09/2020, 9:17 AM
    Hello everyone, I have problem with Coroutine - Flow and retrofit Does anyone know why Coroutine doesn’t work with QueryMap? Thanks.
    Not Work:
    
    @GET("/users")
        suspend fun getUsers(
                @QueryMap params:Map<String,Any>): BaseResponse<List<UserDto>>
    
    
    Work: 
    @GET("/users")
        suspend fun getUsers(
                @Query("lat") lat:Double,
                @Query("long") lon:Double,
                @Query("genders")genders: String,
                @Query("age_max") ageMax:Int,
                @Query("age_min") ageMin:Int
        ): BaseResponse<List<UserDto>>
    My Repository implement:
    fun search(params:Map<String,Any>) = flow {
            emit(service.getMatchedUsers(params
            ).data.map {
                it.mapToDomainModel() }.toList())
        }
    g
    • 2
    • 1
  • a

    alec

    07/13/2020, 11:56 AM
    I think it’s multi platform compatible
    b
    • 2
    • 3
  • g

    gsala

    07/23/2020, 8:51 AM
    Hi. I'm using Retrofit together with JW's kotlinx.serialization converter and I have a problem with one endpoint returning YAML instead of JSON like the rest of the API. Is there a way to configure Retrofit to use a different converter for a specific endpoint?
    j
    j
    • 3
    • 4
  • j

    jw

    07/27/2020, 2:40 PM
    we cannot release until our upstream dependencies release. is the RC binary compatible with 1.4.0 final? Because if not we probably won't do a release
    m
    • 2
    • 1
  • a

    adams2

    08/03/2020, 3:24 PM
    how do I start troubleshooting this intermittent NPE in the moshi compiler
    z
    • 2
    • 5
  • w

    wasyl

    08/08/2020, 4:03 PM
    I have a question about Anvil, as I see that
    ContributesBinding
    doesn’t support multibindings or qualifiers. Is support planned (or will be accepted if someone contributes), or there are some issues with it/it’s not in the scope of the library?
    r
    • 2
    • 5
  • r

    Rohan Maity

    08/10/2020, 12:05 PM
    Hello , could I write suspend functions using kotlinpoet ?
    d
    • 2
    • 2
  • c

    Colton Idle

    08/12/2020, 10:43 PM
    In retrofit (using kotlin), if I don't know the type coming back, but I want to make the network call so that I can inspect the request/response in charles... wouldn't I do this?
    suspend fun getItem(): Response<Any>
    Doesn't compile... and my google fu (im assuming someone has inquired about this before) is failing me.
    j
    • 2
    • 9
  • b

    Bruno Kongawi

    08/13/2020, 10:38 PM
    @Zach Klippenstein (he/him) [MOD] one of the trickiest things I have experienced while building features with Scoop (Lyft) framework was transition animations between two views/plugins (with a potential shared element). It also seems like it is not trivial in Ribs (Uber's) either. How would you envisage this being achieved easily in (Android) worklow where the animations is shared between two workflows? I imagine the transitions could be done by passing in a prop into the secondary workflow; the result of the first workflow would be the input prop of the secondary one?
    z
    r
    • 3
    • 32
  • t

    timrijckaert

    08/21/2020, 11:09 AM
    Does anyone know if it is possible to use named argument in
    SQLDelight
    statements but keep the type safety? It seems like using named arguments will result in all arguments being generated as `String`s Simple example: SQL Statement:
    UPDATE UploadItem SET lastModifiedTimeStamp = ? WHERE id = ?
    Will generate:
    fun updateUploadState(
      lastModifiedTimeStamp: Long,
      id: Long
    )
    Which is correct ✅ However when using named args:
    UPDATE UploadItem SET lastModifiedTimeStamp = (:someOtherNameForLastModifiedTimeStamp || ' ?') WHERE id = (:someOtherName || ' ?')
    Will generate:
    fun updateUploadState(
      someOtherNameForLastModifiedTimeStamp: String,
      someOtherName: String
    )
    n
    • 2
    • 3
  • a

    andev

    08/22/2020, 6:49 PM
    as a workaround currently, i have separate sq file, where i store all my
    create table
    statements with the right order
    n
    • 2
    • 1
  • k

    kevin.cianfarini

    08/26/2020, 1:43 AM
    I'm working on writing some benchmarks in Okio for a PR. Any idea why
    ./gradlew jmh
    is only running writeHex benchmarks? This is my first time dipping my toes in JMH so any help is appreciated 😬
    • 1
    • 3
  • j

    jw

    08/28/2020, 3:30 AM
    looks like a normal timeout. that's a big file, it'll take a long time.
    s
    • 2
    • 1
  • j

    Jeff

    08/30/2020, 5:52 AM
    I think I might go with exposed for JVM. I still do not understand how I can use sqldelight for both postgres and sqlite in the same project.
    v
    • 2
    • 2
  • n

    Nikky

    08/30/2020, 9:39 AM
    trying to force my way through anyways to be able to report the issues..
    v
    • 2
    • 25
  • e

    Elka

    08/31/2020, 6:18 AM
    Kotlin multiplatform SqlDelight + Kotlinx-Serialization Has anyone tried to use SqlDelight with Kotlinx-serialization to parse the entities in JSON format, then, store them to the database? The JSON and the database table can be represented with the same model which is the one generated by SqlDelight. Trying to use the external serializer feature of Kotlinx-serialization but it doesn't look like it works well with
    null
    attributes specially that the JSON does NOT include the keys with null values like
    "someAtt": null
    . We're open to any suggestion on how to handle this considering that we have 40+ tables and we prefer if we don't duplicate the model or write the serializers ourselves.
    n
    • 2
    • 12
  • j

    jw

    08/31/2020, 12:29 PM
    File a bug please
    n
    • 2
    • 1
  • j

    jameswald

    08/31/2020, 11:20 PM
    Has anyone noticed the latest SQLDelight plugin hanging Android Studio frequently for up to a minute or two at a time? I’m looking at thread dumps from Studio and it’s all over those logs. I think it’s either this or the Kotlin 1.4 plugin.
    ➕ 1
    • 1
    • 2
  • j

    janvladimirmostert

    09/05/2020, 8:52 AM
    does SQLDelight support Jasync or other async DB drivers ?
    a
    • 2
    • 1
  • e

    Elka

    09/08/2020, 11:29 AM
    Is there a way to update an object in SqlDelight?
    INSERT OR REPLACE
    would cause the record to be deleted and reinserted which might trigger foreignkey updates like ON CASCADE DELETE...
    k
    a
    • 3
    • 9
  • j

    jessewilson

    09/27/2020, 1:43 AM
    That's quite strange. Is it possible your interceptor behaves differently in release environments only?
    p
    • 2
    • 1
  • n

    nrobi

    09/29/2020, 7:46 AM
    Anyone had similar issues with
    SqlDelight 1.4.3
    ?https://github.com/cashapp/sqldelight/issues/1992
    s
    • 2
    • 1
  • a

    alec

    10/05/2020, 12:59 PM
    Check the migration file which adds the location table and see if it’s failing
    z
    k
    • 3
    • 6
  • c

    Colton Idle

    10/08/2020, 3:31 AM
    Yeah. I've been reading more online. Like most security issues... there's a lot of wiggle room in what you should do. I guess my point was that I don't see how client side hashing or encryption accomplishes anything, but it seems like basically it's used to obfuscate logs really and not used for protecting a MITM. I really wish there was a security guide for mobile apps or something that took into account what other organizations do. I feel like security is never ending rabbit hole and people can always come up with hypothetical attack vectors.
    z
    j
    • 3
    • 2
  • c

    Colton Idle

    10/16/2020, 1:34 PM
    Implementing/learning/reading about r8/proguard. I stumbled upon the PR from Zac Sweers to add default r8 rules to kotlin-reflect and I'm reasearching whether or not my deps that come from square require proguard rules. Is the gist of r8 that you won't have to add proguard rules to any deps unless they use reflection?
    w
    z
    • 3
    • 8
  • s

    saket

    10/27/2020, 3:06 PM
    What's the error stacktrace?
    m
    • 2
    • 15
  • c

    Cyril Find

    11/03/2020, 8:39 AM
    Hi there, i'm trying to setup Wire with grpc so I have proto files generating code but there is a
    Type mismatch: inferred type is Long? but Any was expected
    error on the
    Long?
    type in generated methods that look like this
    override fun ReadPost(): GrpcCall<Long?, Post> =...
    (from
    rpc ReadPost(google.protobuf.UInt64Value) returns (Post) {}
    ) I dont understand what's going on and I can't seem to find anything on SO or anywhere. It's the first time I use this kinda stuff so maybe I forgot something silly ?
    e
    • 2
    • 4
Powered by Linen
Title
c

Cyril Find

11/03/2020, 8:39 AM
Hi there, i'm trying to setup Wire with grpc so I have proto files generating code but there is a
Type mismatch: inferred type is Long? but Any was expected
error on the
Long?
type in generated methods that look like this
override fun ReadPost(): GrpcCall<Long?, Post> =...
(from
rpc ReadPost(google.protobuf.UInt64Value) returns (Post) {}
) I dont understand what's going on and I can't seem to find anything on SO or anywhere. It's the first time I use this kinda stuff so maybe I forgot something silly ?
after investigating more, I'm lost because all "wrapper values" seem to be mapped to nullables, for ex:
UINT64_VALUE: ProtoAdapter<Long?>
but
GrpcCall
doesn't accept nullables:
interface GrpcCall<S : Any, R : Any>
ok so replacing all
google.protobuf.UInt64Value
by a redefined
CustomUInt64Value { uint64 value = 1; }
works but it seems weird to me is this a bug i should file somewhere ?
e

egorand

11/04/2020, 1:42 AM
Yeah, filing an issue on GitHub would be nice, thanks!
c

Cyril Find

11/04/2020, 1:39 PM
ok i just did 🙂 https://github.com/square/wire/issues/1846
View count: 3