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

    hfhbd

    01/31/2022, 1:22 PM
    Sqldelight: When the query returns only 1 column, should the compiler generate a new class with only one attribute or return the attribute instead without a (useless) wrapper class? In the gif from the website, after updating
    playerForNumber
    , the attribute
    name
    is not found.
    p
    • 2
    • 8
  • h

    Humphrey

    01/31/2022, 5:24 PM
    When I use SQLDelight (1.5.3) I do
    database.Schema.create(driver)
    . I'm using a file based database. Second time I start my application the database already exists. I don't want it to recreate the tables. What is a good approach for that?
    j
    m
    • 3
    • 12
  • s

    spierce7

    02/01/2022, 8:25 PM
    For SQLDelight with the MySQL dialect - is there any way to insert or update? i.e. it doesn’t seem like replace is supported. Am I missing something maybe?
    a
    • 2
    • 2
  • b

    Benoit Quenaudon

    02/04/2022, 1:42 AM
    Not creative but create tmp table, insert into tmp from selection * from current, drop current, rename tmp to current
    ☝️ 1
    s
    j
    e
    • 4
    • 14
  • s

    spierce7

    02/04/2022, 2:22 AM
    @alec What would you recommend I do to understand whats going on in sql-psi so I can help contribute to the project. I understand kind of what’s going on in parts of the bnf files, but when I search online for what the heck bnf files are I don’t find anything relevant.
    a
    • 2
    • 1
  • j

    james

    02/10/2022, 12:33 AM
    yeah, unescaping only. I had wrongly assumed that it would be a big task but it seems those four strings are the only cases I need to handle for my use case
    e
    • 2
    • 1
  • b

    Benoit Quenaudon

    02/14/2022, 10:06 PM
    We tend to use Compose as much as possible, and as a whole we believe it's the future for Android views. If one cannot write composable views, Contour is amazing.
    ➕ 2
    b
    • 2
    • 2
  • v

    Vivek Modi

    02/15/2022, 10:54 AM
    Hey I am working in retrofit in android kotlin. I want to track progress when we uploading file in server. I tried this solution it's working fine.
    implementation "com.squareup.retrofit2:retrofit:2.9.0"
    1. How to pause uploading the file through server as well. 2. How to cancel uploading the file.
    • 1
    • 1
  • c

    Colton Idle

    02/16/2022, 2:26 AM
    Hm.
    val request = chain.request().newBuilder().removeHeader("If-None-Match").build()
    Didn't work as an application interceptor. Going to give network interceptor a whirl
    y
    • 2
    • 6
  • d

    dimsuz

    02/24/2022, 2:19 PM
    Found
    @SingleIn
    in Anvil's sample. I wonder will dagger differentiate
    @SingleIn(Scope1::class)
    and
    @SingleIn(Scope2::class)
    during code generation (and after) as different scopes? JSR docs seem to mention that
    @Scope
    -ed annotations shouldn't have attributes, so I thought does this mean dagger will look only at annotation name?
    z
    t
    • 3
    • 6
  • d

    dimsuz

    02/24/2022, 2:42 PM
    I'm seeing this error from applying anvil plugin:
    e: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.util.IdSignature$PublicSignature org.jetbrains.kotlin.ir.util.IdSignature.asPublic()'
    found the similar github issue, it says to update anvil version, but I'm already using: kotlin-1.6.10 anvil-2.3.11 dagger-2.39.1 // this one is a bit old could it be because of dagger version?
    z
    • 2
    • 3
  • d

    dimsuz

    02/25/2022, 1:56 PM
    I am using Anvil and I have a class with no arg constructor and which doesnt extend any interface and I'm tempted to add it with
    @ContributesBinding(...)
    , but this requires that target class extends some interface. Is it wrong to wish this? It just looks simpler than writing a boring provide with
    MyClass()
    in the Module.
    n
    r
    • 3
    • 5
  • d

    Dorit Rein

    02/25/2022, 9:29 PM
    Is there a way to force the order of Anvil `CodeGenerator`s so i can use a generated provision module in a separate generated file?
    r
    • 2
    • 1
  • s

    Spikey Sanju

    02/26/2022, 8:57 AM
    Why My
    SQL Delight's
    Todo notes app are not persisting data when I install My
    Desktop Compose  App
    as
    DMG
    file on my
    M1 Macbook
    ? But everything works fine on my dev machine.
    • 1
    • 1
  • d

    dave08

    02/27/2022, 4:26 PM
    What could be the cause of getting (latest anvil version for 1.6.10):
    com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: Couldn't resolve class for anvil.module.AppComponentAnvilModule.
    File being compiled: (11,1) in /anvil/module/AppComponentAnvilModule.kt
    r
    • 2
    • 5
  • d

    dimsuz

    03/01/2022, 4:06 PM
    Any idea why IDE doesn't see the component contributed with anvil? You can see it's gray and unused (also there are red unresolved ref errors in usage sites), but it compiles fine. I can call
    myComponent.createCoordinator()
    and the instance is created. If I switch to non-anvil dagger it starts to work. Do I need to include some additional source set? Currently default from kotlin plugin are used
    d
    r
    • 3
    • 6
  • a

    ankushg

    03/03/2022, 1:16 AM
    I’m considering using SQLDelight in a (multiplatform) project to store some read-only JSON documents. I was planning on implementing `ColumnAdapter`s that use
    kotlinx.serialization
    to serialize/deserialize an actual class from a String column I’m trying to determine how to handle changes to the JSON document’s schema (which is just a change in the
    @Serializable data class
    ). In most of those cases, I’d be fine with dropping the old data and repopulating it next time I fetch from the server. I could write a
    .sqm
    file that drops all rows in the tables containing impacted documents, but I’m foreseeing situations where someone updates the data class without writing a migration. Since the sqlite schema would still just have the row as a String, I’m assuming that SQLDelight’s migration verifications would still pass. Is there a way to ignore/drop data that doesn’t deserialize properly in my
    ColumnAdapter
    ? Should I just be making all of my types nullable?
    p
    • 2
    • 1
  • r

    Rak

    03/04/2022, 10:15 AM
    Hi, I need to upload a jpeg to my server which accepts multipart(?). The image was taken with the camera on mobile (examples around the web reference browsers) and is held in memory. How to upload with retrofit? The docs talk about
    RequestBody
    but not sure how to put it all together.
    p
    y
    • 3
    • 4
  • b

    brabo-hi

    03/06/2022, 7:38 AM
    hi all, when using paging on sqldelight, how can we handle query filtered?
    countPlayers:
    SELECT count(*) FROM hockeyPlayer WHERE full_name = ?;
    
    players:
    SELECT *
    FROM hockeyPlayer WHERE full_name = ?
    LIMIT :limit OFFSET :offset;
    
    val pagingSource: PagingSource = QueryPagingSource(
      countQuery = playerQueries.countPlayers(full_name),
      transacter = playerQueries,
      dispatcher = <http://Dispatchers.IO|Dispatchers.IO>,
      queryProvider = playerQueries.players(full_name), // <---- issue
    )
    a
    • 2
    • 2
  • j

    jw

    03/11/2022, 2:12 AM
    it seems like they're simply ignoring HTTP cache headers entirely and assuming everything can be cached forever. not sure that's a smart idea.
    t
    c
    • 3
    • 2
  • j

    jessewilson

    03/11/2022, 12:24 PM
    And.... we should fix
    ➕ 2
    c
    • 2
    • 2
  • d

    Drew Heavner

    03/16/2022, 2:24 PM
    Does anyone have any good resources for writing tests for custom Anvil CodeGenerators?
    ➕ 2
    r
    • 2
    • 2
  • r

    Rak

    03/18/2022, 10:09 AM
    Hi, in the moshi docs it state to use this version of ksp
    id("com.google.devtools.ksp").version("1.6.0-1.0.1")
    , this led to issues with codegen not working. I found the error message when building on the command line (gradlew build) but NOT when compiling and running my app with the AS. The app crashed at runtime saying the Adapter class could not be found. I found the latest version to use was
    1.6.10-1.0.4
    and it all worked.
    z
    • 2
    • 4
  • e

    ephemient

    03/22/2022, 4:09 PM
    I think https://square.github.io/okhttp/4.x/okhttp/okhttp3/-authenticator/ describes it well enough. for pre-emptive proxy auth, null continues with original request. for reactive auth, the original request was already made and came back with a unauthorized response; null makes that the final response instead of making a follow-up request
    👍 1
    l
    • 2
    • 5
  • e

    Edwar D Day

    03/31/2022, 8:32 AM
    I'm trying to use
    DATE_ADD
    (https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-add) in an sql statement with sqldelight, but sqldelight complains
    '(', ')', '.', <binary like operator real>, BETWEEN or IN expected, got '6'
    The used SQL code:
    date_add(current_date() , interval 6 month)
    Am I doing something wrong or is there a workaround for such a case?
    a
    • 2
    • 5
  • j

    jw

    04/04/2022, 12:13 PM
    Yep
    👍 1
    k
    • 2
    • 1
  • b

    brabo-hi

    04/05/2022, 1:08 PM
    Hi all on the version 2.x, how to use named query instead of anonymous
    ?
    DELETE FROM customer WHERE customer_id = :customerId;
    It doesn’t look working for this version but was working on version 1.x
    a
    • 2
    • 7
  • s

    Slackbot

    04/05/2022, 4:30 PM
    This message was deleted.
    t
    • 2
    • 1
  • a

    Andrew O Hart

    04/06/2022, 10:54 AM
    Hey, I created a new .sq file, which has CREATE TABLE LastModificationDate(lastModificationDate TEXT NOT NULL); This causes a crash when testing against our production app as it says LastModificationDate. no such table: LastModificationDate: , while compiling: SELECT * FROM LastModificationDate I'm not sure how I am meant to migrate this new table, in the .sqm file I don't think I'm altering anything as its actually just a new table, so should I be creating the table in the .sqm? If so, how does that work with the functions that exist in LastModificationDate such as insert/get/delete
    a
    • 2
    • 12
  • l

    Landry Norris

    04/07/2022, 6:58 PM
    After updating to 1.6.20, I’m getting an error in iosMain saying that okio cannot be found. Same with FileSystem. Downgrading to 1.6.10 seems to fix it, but I’d like to be on the latest Kotlin if possible. Is anyone else seeing this?
    t
    • 2
    • 2
Powered by Linen
Title
l

Landry Norris

04/07/2022, 6:58 PM
After updating to 1.6.20, I’m getting an error in iosMain saying that okio cannot be found. Same with FileSystem. Downgrading to 1.6.10 seems to fix it, but I’d like to be on the latest Kotlin if possible. Is anyone else seeing this?
t

Trevor Stone

04/08/2022, 1:12 PM
1.6.20. changed default properties for hierarchical projects. If you weren't using them before you might need to explicitly disable now https://kotlinlang.org/docs/whatsnew1620.html#configuration-and-setup
l

Landry Norris

04/08/2022, 4:48 PM
I am using hierarchical project support. The project needs to support basically every kotlin platform, so being able to set up a nativeMain, mobileMain, desktopMain, androidMain, androidNdkMain, iosMain, etc separately is critical.
View count: 25