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
stackoverflow
  • u

    user

    07/22/2022, 11:01 AM
    Import local npm package with gadle/kotlin I want to import a local npm package into my kotlin project but I get the error Can't add "convert": invalid package version "". File structure: project - js - package.json - convert.js - src - build.gradle.kts My build.gradle.kts: plugins { kotlin("js") } dependencies { implementation(npm("convert", "file:../../../../wikimarkup-converter/js")) } configureKotlinJs() configurePublication() My path is correct, because it gives me another error when it's any different. My...
  • u

    user

    07/22/2022, 11:01 AM
    Null properties in RequestScope bean in Spring Boot and Kotlin Spring Boot 2.7.2 Kotlin: 221-1.7.10-release-333-IJ5591.52 @SpringBootApplication class AbcApplication fun main(args: Array) { runApplication(*args) } @RestController class Home(val importantContext: ImportantContext) { @GetMapping fun index(): Any { return "toString: '${importantContext}' VS message: '${importantContext.importantMessage}'"; } } @Configuration class ImportantConfiguration { @Bean @RequestScope fun importantContext(): ImportantContext...
  • u

    user

    07/22/2022, 11:01 AM
    Retrofit - how I can access object, that has same name in two different api call endpoints? I'm trying to build an app, that connects to the api, for retrieving some specific data for every fragment. I've faced a problem, where I can't retrieve some of the data, because I would have to use @SerializedName("qwe") twice. Here's the example: The api has different endpoints, to retrieve different data, but the json response has same name for json object for two of endpoints. First endpoint: "qwe"{ "X": { "start_rate": 3.3, "end_rate": 2.2, "change": -1.1,...
  • u

    user

    07/22/2022, 11:01 AM
    How to handle multiple types of value from a single key in json https://github.com/sumitkolhe/jiosaavn-api/issues/21 The "downloadUrl" key in json is returning a list of urls in some cases and in some cases it is returning false ( a boolean value ) . So how to handle it ? Can anyone please tell how to handle this in Android using Kotlin ?? I am getting a resopnse of type SearchSongs . Here is my POJO class <a href="

    https://i.stack.imgur.com/9M8Xy.jpgâ–¾

    "...
  • u

    user

    07/22/2022, 11:01 AM
    Flutter Execution failed for task :compileDebugKotlin. Failed to transform flutter.jar to match attributes Can't able to debug this flutter project. This error occurs only on one of my devices. but on my other device, it is working fine. I checked for all configurations between devices all were same. if I removed this package "flutter_subscreen_plugin" I can able to debug. [+14758 ms] FAILURE: Build failed with an exception. [ +15 ms] * What went wrong: [ +8 ms] Execution failed for task ':flutter_subscreen_plugin:compileDebugKotlin'. [ +4 ms] > Could not resolve all files for configuration...
  • u

    user

    07/22/2022, 11:21 AM
    Calling Coroutine functions from Java I have written a small library for async testing in Kotlin with JUnit, which is based on coroutines with runBlocking scope. I would like to have at least some kind of interop with Java. My coroutine knowledge is limited, but my idea was that if I let Kotlin create the scope and only bridge suspend function calls in Java class, passing the Continuation created by Kotlin method to method it might work. Currently I have something like this construct class AsyncTestLibrary { fun...
  • u

    user

    07/22/2022, 11:21 AM
    Collect an image from Firebase storage (kotlin) I'm developing a simple customer profile page for my app. What I need: This page has to display the customer's profile image and to allow to change it, uploading the selected one to Firebase storage and the URI referement to the Firebase Realtime Database. What I did: The CustomerMainActivity has a bottom navigation with four tab. One is for the customer profile, so it hosts the CustomerProfileFragment that is shown below. The layout of the fragment has an ImageView (ivCustomerProfile) for...
  • u

    user

    07/22/2022, 11:21 AM
    Android Jetpack Compose keyboard not close Compose keyboard not close when scrolling

    everything is okeyâ–¾

    I'm scrolling but keyboard not closeâ–¾

    how can i solve this? thank you in advance for the answers.
  • u

    user

    07/22/2022, 11:41 AM
    Type mismatch error when fetching API with RxJava I'm trying to fetch API with RxJava by following this tutorial:

    https://www.youtube.com/watch?v=VObSnk5jrpc&list=PLRRNzqzbPLd906bPH-xFz9Oy2IcjqVWCH&index=6â–¾

    But I got an error saying: Type mismatch. Required: io.reactivex.disposables.Disposable! Found: io.reactivex.rxjava3.disposables.Disposable! Here is the code: try{ compositeDisposable.add(...
  • u

    user

    07/22/2022, 12:01 PM
    Read data from SQliteCipher without creating Helper Class while Migrating SQLiteCipher (V1) to Room (V2): I build two apps with the same package name: In the first app, I use SQLiteCipher using "Pass_Phrase" (Version_1 DB) for CRUD operations using Java. In the second app, I just wanted to read data (without making helper class) from SQLiteCipher and put it into Room (Version_2 DB) using Kotlin. I completed the first app and was stuck at Reading SQLitecipher Data in the second app. Need your help. Thanks a lot! Code: UserDB.kt @Database(entities = [User::class], version = 2, exportSchema =...
  • u

    user

    07/22/2022, 12:01 PM
    Is it possible to take a screenshot when it show " Couldn't save screenshot"?

    Couldn't save screenshotâ–¾

    I have searched for " secure-flag " text in that app by using APK Parser. But didn't find any. So, is there any method to take screenshot on android app that doesn't allow to take screenshot??
  • u

    user

    07/22/2022, 12:41 PM
    how to perform a recursive query on firbase with kotlin Im building an app to learn firebase and kotlin. in this app users are able to submit text as a child element of another submission. The depth could be infinite. Like millions. I figured the best way to structure the database for the text submissions would be like this: collection |-> doc_id |-> title | |-> text | |-> doc_id_of_parent | |-> doc_id |-> title | |-> text |->...
  • u

    user

    07/22/2022, 12:41 PM
    Limit resolution of images when taking photos using REQUEST_IMAGE_CAPTURE I have little app in which I take photos like this startActivityForResult(intent, REQUEST_IMAGE_CAPTURE) and in the onActivityResult Method I recall takePhoto. But the photos are taken in the maximum camera size and with actual Samsung phones it is no longer possible to limit the resolution of the images. But when the photos are getting too big the app gets unstable when many photos are taken in quick succession. So I would like to limit the resolution of the camera, but I cannot find a way...
  • u

    user

    07/22/2022, 1:01 PM
    Map marker with multiple drawables I have a map with some markers, and each of them has icons. My thinking, is it possible to add another icon/drawable to an existing one. For example, a map pin, after a click on it, the icon/drawable is added at the bottom right.

    https://i.stack.imgur.com/2DB6l.pngâ–¾

  • u

    user

    07/22/2022, 1:01 PM
    cannot create file from contentbytes received from microsoft graph api in java android So I have been working around with Microsoft Graph API's. I'd like to get email attachments from this API GET /me/messages/{id}/attachments/{id} This is the API which I am using. I am getting contentBytes encoded in Base64 How to create file from contentBytes in JAVA? Here is what I implemented to create the file which is not writing any thing in file try { if (f.exists()) f.delete(); f.createNewFile(); FileOutputStream fos = new FileOutputStream(f); fos.write(fileData);...
  • u

    user

    07/22/2022, 1:01 PM
    [mockk][Kotlin][Failed to transform class java.lang.IllegalStateException: A wildcard does not represent an erasable type:? I am trying to mock a Usecase(interface) in project and I am getting this exception while mocking one interface did anyone encountered such issue while using this? please help. java.lang.IllegalStateException: A wildcard does not represent an erasable type: ? at net.bytebuddy.description.type.TypeDescription$Generic$OfWildcardType.asErasure(TypeDescription.java:4491) at net.bytebuddy.description.type.TypeList$Generic$AbstractBase.asErasures(TypeList.java:336) at...
  • u

    user

    07/22/2022, 1:01 PM
    ANR at MessageQueue.java I am facing this ANR and root cause is unknown for this, there is no minimum viable reproducible example for this anyone else encountered this on production, I am pasting the logs. main (native): tid=1 systid=10663 #00 pc 0xd8b38 libc.so #01 pc 0x19d88 libutils.so #02 pc 0x19c68 libutils.so #03 pc 0x11409c libandroid_runtime.so at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:339) at...
  • u

    user

    07/22/2022, 1:21 PM
    Loop through an array and print how many thimes it gets repeated in Kotlin? I'm leaning Kotlin, and I'm wondering if there is a better, simpler and not that complicated way to do this in kotlin? I need to Write a Kotlin program that loops through an array and generates a histogram based on the numbers in it.The results should look like this(vertically): 1: ***** 2: ** 3: ** 4: 5: * And this is what I did: fun main() { val myArray: IntArray = intArrayOf(1,2,1,3,3,1,2,1,5,1) for(num in 1..5){ println("") print("$num: ") for(element in myArray) {...
  • u

    user

    07/22/2022, 2:01 PM
    How to use cellIdentityNr &amp; cellSignalNr show some information in 5G? I have used some commands to display some parameters in 3G and 4G environment, but it does not work in 5G (Nr) environment, what is the problem?

    enter image description hereâ–¾

  • u

    user

    07/22/2022, 2:41 PM
    Draw square box using the coordinates on image in android(JAVA) I have some coordinates which is coming from the backend. I need to draw some rectangles or squares according to the coordinates on image in the (JAVA) android app. The rectangles or squares should be clickable

    you can see the coordinates in the imageâ–¾

  • u

    user

    07/22/2022, 2:41 PM
    Rolling out android app in a phased manner through play store automatically I am trying to reduce the manual step of rolling out the android app manually through the play console. This is about increasing the rollout percentage of the app manually I found a solution here - http://angelolloqui.com/blog/42-automating-rollout-android I've decided to do this change in my android repo under the Fastlane configuration. How can I hook this up to circle CI?
  • u

    user

    07/22/2022, 3:01 PM
    Attempt to invoke virtual method 'void org.jitsi.meet.sdk.JitsiMeetView.setListener(java.lang.Object)' on a null object reference I am a beginner in Android development, and I am trying to integrate Jitsi Meet into my chatting app. Whenever I accept the call my app crashes on both ends, and I get this log; Process: ca.scooter.talkufy, PID: 14956 java.lang.RuntimeException: Unable to start activity ComponentInfo{ca.scooter.talkufy/org.jitsi.meet.sdk.JitsiMeetActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.jitsi.meet.sdk.JitsiMeetView.setListener(java.lang.Object)' on a null...
  • u

    user

    07/22/2022, 3:21 PM
    Sorted map with custom comparator I want to create a sorted map with a composite key. If it didn't need to be sorted, I would use val myMap = mapOf( Pair(1,"a") to "A", Pair(2,"a") to "AA", Pair(1,"b") to "B" ) But it has to be a sorted map and this doesn't work: val myMap = sortedMapOf( Pair(1,"a") to "A", Pair(2,"a") to "AA", Pair(1,"b") to "B" ) What's the most idiomatic way to create a sorted map with a custom comparator? I want it to compare by the first element of the pair and then by the second.
  • u

    user

    07/22/2022, 3:41 PM
    Retrieving frequency ranges from android visualizer FFT I am currently attempting to do something very similar (or maybe the same) as the following question: Getting variable frequency ranges with androids visualizer class However, the selected answer has a few bugs, and I'm not a DSP/Audio expert at all and I'm learning as I go. My goal is to break an FFT that I'm getting from Android Visualizer class into frequency bands....
  • u

    user

    07/22/2022, 3:41 PM
    Kotlin error= lateinit property bilimarraylistt has not been initialized I want to use recylerview,fragment and firestore in this small project, but kotlin.UninitializedPropertyAccessException: lateinit property Bilimarraylistt has not been initialized at com.example.projemvvmfirebase.view.bilimfragment.firestore$lambda0(Bilimfragment.kt:102) I could not solve the error . Can you help me please

    enter image description hereâ–¾

    <a href="

    https://i.stack.imgur.com/VbO3f.pngâ–¾

    " rel="nofollow...
  • u

    user

    07/22/2022, 4:21 PM
    Share ListView content in kotlin my application that displays the content of firebase databases in ListView . I want Share all content the ListView in Social Media I need help from you on the topic of publishing the content of a ListView . Thank you employeeList = mutableListOf() listview = findViewById(R.id.listview1) ref = FirebaseDatabase.getInstance().getReference("rrrdb") ref.addValueEventListener(object : ValueEventListener { override fun onCancelled(error: DatabaseError) {...
  • u

    user

    07/22/2022, 4:41 PM
    Ktor | How to connect FreeMaker-Templates with Image? Hello everyone, I just started learing Kotlin and Ktor for Web Development. I started creating a Template and everything worked perfectly but now I want to add an image to my Templates. In the Kotlin Docs they created a static route but I'm getting the following error: /img/logo.png. Exception class freemarker.core.ParseException: Syntax error in template "img/logo.png" in line 114, column 255 NK
  • u

    user

    07/22/2022, 4:41 PM
    how to show Image Preview In ShareSheet in android while sharing both image and text In intent currently in preview its showing text,but i want image to be shown in preview instead of text val bitmapUri = Uri.parse(path) val intent = Intent(Intent.ACTION_SEND_MULTIPLE) val share = Intent.createChooser(Intent().apply { intent.type = "image/*" action = Intent.ACTION_SEND_MULTIPLE putExtra( Intent.EXTRA_TEXT, "NcQAvD_BwE" ) // to share image URL putExtra(Intent.EXTRA_STREAM, bitmapUri) }, null)...
  • u

    user

    07/22/2022, 5:21 PM
    java.lang.RuntimeException: Exception while computing database live data I learning Room library for creating apps with sqlite database, but I get an error. In the first launching when I add item to DB, it navigate to fragment with RecyclerView and after 1 second my app crashes. Error E/SQLiteQuery: exception: Row too big to fit into CursorWindow requiredPos=0, totalRows=1; query: SELECT * FROM vet_product ORDER BY id ASC E/AndroidRuntime: FATAL EXCEPTION: arch_disk_io_0 Process: com.dimon.vetdatabasemobile, PID: 26700 java.lang.RuntimeException: Exception...
  • u

    user

    07/22/2022, 5:41 PM
    Jetpack Compose:LazyVerticalGrid within Column with verticalScroll modifier throws java.lang.IllegalStateException I am trying to achieve this:

    https://i.stack.imgur.com/nJ7co.jpgâ–¾

    This section is inside my ProductDetailsScreen composable. Here is the code: @Composable fun ProductDetailsScreen( modifier: Modifier = Modifier ) { val scrollState = rememberScrollState() Column(modifier = Modifier .padding(horizontal = dimensionResource(id = R.dimen.dimen_24)) .verticalScroll(scrollState) // this makes the screen...
Powered by Linen
Title
u

user

07/22/2022, 5:41 PM
Jetpack Compose:LazyVerticalGrid within Column with verticalScroll modifier throws java.lang.IllegalStateException I am trying to achieve this:

https://i.stack.imgur.com/nJ7co.jpgâ–¾

This section is inside my ProductDetailsScreen composable. Here is the code: @Composable fun ProductDetailsScreen( modifier: Modifier = Modifier ) { val scrollState = rememberScrollState() Column(modifier = Modifier .padding(horizontal = dimensionResource(id = R.dimen.dimen_24)) .verticalScroll(scrollState) // this makes the screen...
View count: 9