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
moko
  • k

    Kamil Kalisz

    08/06/2021, 3:54 PM
    Hello 🙂 I have case that I would like to use TokenFeature with FirebaseAuth, but my problem is that token/token change event could be obtained only from suspend function, so my idea was to keep it’s value in variable. unfortunately HttpClient freezes everything, (i know why). But I would like make to ask what is best approach in that case ? Use some atomics ? or maybe you have some other advices.
    fun createHttpClient(): HttpClient {
        var token: String? = "" // <- frozen 
        CoroutineScope(Dispatchers.Main).launch {
            token = Firebase.auth.currentUser?.getIdToken(false)
            Firebase.auth.idTokenChanged.collect { user ->
                token = user?.getIdToken(false)
            }
        }
        
        val client = HttpClient {
            install(TokenFeature) {
                tokenHeaderName = "Authorization"
                tokenProvider = object : TokenFeature.TokenProvider {
                    override fun getToken(): String{
                        return "Bearer $token" <- frozen 
                    }
                }
            }
        }
        return client
    }
    a
    • 2
    • 2
  • v

    Vadzim Filipovich

    08/09/2021, 8:01 PM
    Hey guys, any news or plans about Jetpack Compose and MokoMVVM? Could I just provide viewmodel instance to composable (with Kodein for example) and just use it without databindings? Does update of LiveData from your package trigger recomposition?
    a
    • 2
    • 6
  • z

    Zhiqiang Bian

    08/15/2021, 6:40 PM
    Hi guys! Does Moko support `SharedViewModel`in androidApp? Consider the situation when an
    activity
    holds a
    fragment
    , and I would like to invoke a method of the
    activity viewmodel
    in one of the
    fragment
    .
    private val viewModel: lISTViewModel by activityViewModels()
    ----------- There is a
    getViewModel
    function in
    ViewModelFactory
    , but I don’t know how to use it.😒miling_face_with_tear: ----------- I can simply do
    activity.viewmodel
    in the fragment, so probably
    sharedViewModel
    is unnecessary.
    a
    • 2
    • 2
  • m

    Michal Harakal

    08/25/2021, 2:16 PM
    Hello, I didn't find anything how to deserialize timestamps. Currently generated models converts date time as String. (e.g. like it is defined here https://github.com/bundesAPI/autobahn-api/blob/main/openapi.yaml#L417) Do I miss something? I do remember, that with the plain OpenApi plugin I could define date time library explicitly. For KMP I think a
    kotlinx.datetime.LocalDate
    could be taken by default. Of course there is no deal to do date conversion during DTO=>domain mapping. Any thoughts on this ?
    🤔 1
    a
    • 2
    • 2
  • d

    dbaelz

    09/06/2021, 1:06 PM
    Should the latest moko resources (0.17.2) work with jvm targets without Kotlin multiplatform? I've tried to integrate it in a Desktop app and the plugin can't be applied (
    Caused by: java.lang.ClassNotFoundException: com.android.build.api.dsl.AndroidSourceSet
    )
    a
    • 2
    • 1
  • x

    xxfast

    10/03/2021, 1:18 AM
    Any documentation for the use moko-resource images in SwiftUi?
    a
    • 2
    • 1
  • t

    Thomas Skovsgaard

    10/11/2021, 7:27 PM
    Hi is SwiftUI preview mode in Xcode known to work with Moko Resources ? When I add a shared string to a text like
    Text(MR.strings().btn_login_skip_login.desc().localized())
    preview crashes, if I remove it preview works again. When I run the app the correct shared localised text is displayed.
    a
    x
    • 3
    • 3
  • d

    deviant

    10/22/2021, 10:50 AM
    hey guys does anybody use moko viewModel with koin di? how you declare your viewModels modules in common code? koin
    viewModel
    helper factory available only for android projects. so we use the
    factory
    extension temporarily. but it recreates viewModel each time.
    w
    v
    • 3
    • 13
  • p

    Phil Saul

    12/06/2021, 11:03 AM
    Hi, does moko resources support resource generation for the different variations of languages? en-GB, en-US, es-MX, fr-CA etc
    👀 1
    a
    • 2
    • 2
  • n

    Nacho Ruiz Martin

    01/04/2022, 7:04 PM
    Hey! 👋 I'm experiencing some issues with Moko Resources and XCFramework on iOS. It's similar to this issue but it's with pure XCFramework instead of Swift Package. It's giving a
    bundle with identifier X not found
    and including the Framework in Building Phases's Copy Bundle Resources doesn't fix it. Any tip? Thanks! 🙇
    a
    • 2
    • 3
  • r

    Róbert Nagy

    01/17/2022, 10:05 AM
    Hey @alex009 we’d like to have support for simulators running on M1 for moko-resources. Could you confirm the work would include: 1. https://github.com/icerockdev/mobile-multiplatform-gradle-plugin/blob/master/src/main/kotlin/MultiPlatformLibrary.kt (adding the
    iosSimulatorArm64
    target), publishing a new version with this change 2. Updating moko-graphics to use the new version 3. Updating moko-parcelize to use the new version 4. Updating moko-resources to use the new version of the above mentioned libs
    a
    • 2
    • 14
  • f

    Francis Mariano

    01/25/2022, 5:36 PM
    Hello everyone. I wonder if moko-resources works with flavor on Android.
    a
    • 2
    • 3
  • g

    georgi

    02/05/2022, 11:12 PM
    Hey everyone! Firstly, I wanted to say thanks for the amazing libraries for KMM - I'm using a few and they've been great! I wanted to ask if moko-mvvm/moko-livedata have/will have support for the M1 Macs at some point? More info in 🧵
    a
    • 2
    • 6
  • p

    ptsiogas

    02/07/2022, 9:27 AM
    Hi there, I run into a quite strange issue.
    • 1
    • 1
  • s

    SK

    03/08/2022, 2:08 PM
    Hello there, my team is facing a strange issue when trying to use moko-mvvm, moko-livedata components. We have some code in viewmodel inside viewmodelScope.launch { .. }. Invoking this method (on a button click or something) works for the first time. However, when we repeat the same action, the code inside viewmodelScope.launch doesn't work anymore. @alex009 Can you please help?
    a
    • 2
    • 2
  • a

    Artem Bezlyubchenko

    03/17/2022, 10:51 AM
    Hello guys, I started to explore KMM + moko-template and I’m stacked trying to add cocoapods library to a feature module. May anyone help me or point to the documentation, please? What I’m trying to do: I added `id("dev.icerock.mobile.multiplatform.cocoapods")`to
    :mpp-library:feature:auth#build.gradle.kts
    Also I added
    cocoaPods {
        pod("Auth0")
    }
    to
    :mpp-library:feature:auth#build.gradle.kts
    . I tried to add
    pod 'Auth0', '~> 1.39'
    to Podfile as well. I did a
    pod install
    and trying to run the build. The error I receive is
    ld: framework not found Auth0
    a
    • 2
    • 2
  • l

    Lucas Schiavini

    03/21/2022, 7:34 PM
    Could not find "/Users/mac/Documents/lucasGithub/nelogica/android/shared_core/build/classes/kotlin/ios/main/klib/shared_core.klib" in [/Users/mac/Documents/lucasGithub/nelogica/android/shared_core, /Users/mac/.konan/klib, /Users/mac/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/common, /Users/mac/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/platform/ios_x64]
    a
    • 2
    • 5
  • s

    SK

    03/22/2022, 8:43 PM
    @alex009 We have upgraded moko to 0.12 and all the usages of postValue in the ViewModel are shown as errors. Whats the suggested workaround? How do we set values to the MutableLiveData? We have a huge codebase.
    a
    • 2
    • 10
  • s

    Sean Proctor

    03/28/2022, 12:12 PM
    Hi. I'm having an issue getting moko resources to generate the MR class for jvmMain. I'm trying to share a library between Android and Compose for Desktop. It's generating the commonMain expect class, and the androidMain actual class, but the jvmActual class.
    a
    • 2
    • 3
  • r

    rrva

    05/09/2022, 12:17 PM
    When using enums/sealed classes for error handling in combination with generics, it is sometimes hard to create an instance of an enum/sealed class dynamically. When using multiplatform reflection is forbidden. How would you create such a error object dynamically?
    a
    • 2
    • 1
  • r

    romainbsl

    05/13/2022, 6:57 AM
    Hello 👋 ! I was wondering if someone has solved common testing while using moko-resources. We are convince that more code we put in KMM modules, less error prone it is, thus KMM code is also resolving localisation. But, while testing states that exposes localised strings we have different behavior between JVM and Native targets as Android needs a context, while iOS simulator handle bundles with ease. So, is there a way of testing this, or the only way is to use fakes/mocks of the localisation ? Any help appreciated 🙏.
    a
    • 2
    • 3
  • f

    Francesco Bonnì

    05/13/2022, 1:11 PM
    Hi Everyone, I’m trying moko-resources and I’m finding some problem. I applied the plugin, the libraries on CommonMain and on Android and on build I receive a circular dependencies error. Could someone help me o suggest some actions to find the problem? Thank you
    a
    • 2
    • 2
  • j

    jeran

    05/30/2022, 8:40 PM
    hello all. my team is using moko resources for KMM. first of all, thank you for all the work! we’re working with formatting plurals and realized that the “zero” type works differently on iOS and on Android. saw this comment in one of the tests:
    // 0 on android in english will be other
    the strings we’re hoping to achieve are: x == 0 -> “Just now” x == 1 -> “1 hour ago” x > 1 -> “x hours ago” how can we achieve this if android doesn’t match zero properly? https://github.com/icerockdev/moko-resources/blob/a4759a4439a492b6b8a6f7fa631be7cf[…]library/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
    ✅ 1
    a
    • 2
    • 2
  • k

    kevin.cianfarini

    06/23/2022, 6:30 PM
    Hey @alex009 👋 I’ve opened up a PR for regional language support here. There’s one roadblock with Android’s handling of languages as it traverses up the language tree. I’m hoping for your guidance there. I tried to be as detailed as possible in the Pr, but am happy to hop on a call or something to explain the scenario.
    a
    • 2
    • 5
  • m

    MarkRS

    06/29/2022, 3:29 PM
    Ok, I expect I'm doing something stupid here, but I've followed the installation and usage instructions (I think) and while my IDE (AS) does recognise MR, it fails to find "myString" in the (correctly set up, I think) string file. This is in commonMain, androidMain, and app. (Kotlin 1.7, Moko resources 0.20.1) Is there an obvious "what you've done wrong is", or what else helps track down what I've done wrong?
    a
    • 2
    • 2
  • m

    MarkRS

    06/30/2022, 8:56 AM
    On running the gradle task "generateMr<any>Main" I get the error
    Can't process keys which equals their value
    which is very disappointing as it's very natural to give such names to keys. Is this a hard thing to change? (PS - It should read "which equal their value")
    a
    • 2
    • 2
  • m

    MarkRS

    07/11/2022, 9:39 AM
    I can't get my ios app with CocoaPods to build in my KMM setup with resources. The build fails complaining that it can't find the task "copyFrameworkResourcesToApp" which, indeed, isn't in the list of moko Gradle tasks. There is "podPublishReleaseXCFrameworkToApp", but that doesn't help. I notice the (somewhat) relevant samples seem to all include the plugin "dev.icerock.mobile.multiplatform.apple-framework" and related stuff, even though the installation notes don't mention this at all. Is this what's required here?
    a
    • 2
    • 3
  • j

    Jose Carlos Hernandez

    08/11/2022, 11:39 PM
    Hi guy I’have been struggling with the
    kswift
    integration and can’t compile on iOS getting this error
    error: cannot find 'LoginViewModelActionKs' in scope
                let actionKs = LoginViewModelActionKs(action)
    could you please help me? (I add detail on thread)
    • 1
    • 1
  • s

    Sean Proctor

    08/16/2022, 9:35 PM
    After updating to kotlin 1.7.0, and AGP 7.3.0-rc01, I'm getting an error "Unresolved reference: stringResource" in Android Studio and IntelliJ, but everything still builds fine. Anyone have an idea why?
    k
    • 2
    • 2
  • r

    Róbert Nagy

    08/31/2022, 11:32 AM
    @alex009 any tips on where should I look to troubleshoot this issue? I’ve checked and the
    common.h
    generates the
    MR
    file
    🤔 ✅
Powered by Linen
Title
r

Róbert Nagy

08/31/2022, 11:32 AM
@alex009 any tips on where should I look to troubleshoot this issue? I’ve checked and the
common.h
generates the
MR
file
🤔 ✅
View count: 4