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
touchlab-tools
  • p

    Peter Kucera

    02/22/2021, 8:50 PM
    Hi guys, currently I'm trying to update 1.3.71 project to kotlin 1.4, specifically 1.4.21 (same as latest commit in Kampkit is using). I'm getting following error during build: "Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2-native-mt." I don't understand it though, building and running kampkit code works OK but in my project it fails to resolve the reference, while I am using same repositories / dependencies on a classpath as kampkit. Any ideas ? Thanks
    r
    • 2
    • 2
  • p

    Peter Kucera

    02/25/2021, 2:29 PM
    Hi all. Would you recommend using sealed classes in multiplatform project? Afaik on iOS there is no concept of sealed class, so I’m wondering how swift/objective c code can be integrated with Kotlin/Native code that is taking sealed class as an argument/returning it.
    r
    p
    • 3
    • 3
  • j

    Joseph Roffey

    03/01/2021, 3:37 PM
    Hello, after I run
    ./gradlew test
    , I see a test report that is generated into
    build/reports/tests/testDebugUnitTest/index.html
    However, when I look at this, it does not make the difference between the results of the Android tests and the iOS Tests clear to me. Furthermore, when I add a line
    assertTrue(false)
    into
    iosTest > KoinTest > checkAllModules
    it does not register any failures, whereas when I add the same line into the
    androidTest
    equivalent the test does fail. Should I be running the iOS tests differently / does anyone know whether I have misunderstood something? I was under the impression that when I run the gradle tests it should test both the iOS and the Android KoinTest methods. Sorry if I’m missing something obvious.
    r
    • 2
    • 15
  • l

    Lena Stepanova

    03/08/2021, 4:24 PM
    Hi, I'm trying to setup Koin in my project following KampKit. There are these two lines in common Koin:
    val doOnStartup = koin.get<() -> Unit>() // doOnStartup is a lambda which is implemented in Swift on iOS side
    doOnStartup.invoke()
    When I try running my Android project, it crashes with org.koin.core.error.NoBeanDefFoundException: No definition found for class:'kotlin.jvm.functions.Function0'. Check your definitions! If I remove those two lines, it runs fine. I see that I can remove this doOnStartup both from common Koin and iOS code, because in KampKit it doesn't do anything important. But why doesn't it work in my project, but in KampKit it does?
    r
    • 2
    • 2
  • l

    Lena Stepanova

    03/09/2021, 6:00 PM
    Hello everyone! May be it's a better question for Multiplatform channel, but as my test project is mostly based on KampKit, I'll post it here. I took KampKit as foundation and added some features from PeopleInSpace and MultiplatformPlayground. The biggest change was probably adding jetpack compose dependencies to android build.gradle. Now when I try running android app, the project builds and even says "Launch succeeded", but the app does not start. There is an app icon created, but when I click, I get "App isn't installed". Can anyone give me a hint why this is happening? Here is the reproducer https://github.com/hlnstepanova/testKMP
    r
    b
    • 3
    • 10
  • a

    Archie

    03/10/2021, 2:24 PM
    Hi Guys, I am trying to use Koin Multiplatform for dependency injection. Is there a way to add to the Koin Module when using it in kotlin so I could add in ios specific dependencies?
    k
    r
    • 3
    • 4
  • a

    Archie

    03/11/2021, 10:29 AM
    Hi Guys, I tried converting one of our project's Module which also uses
    Jetpack Compose
    . I tried to convert the module to a
    Multiplatform Module
    and move all android related code to
    androidMain
    but I when building the app
    Compose
    throws error. Also adding
    kotlin("android")
    in the
    Kotlin Multiplatform
    module throw and error
    org.gradle.api.GradleException: Please initialize at least one Kotlin target
    . Is there a way to work around this? Or is it better to create a seperate KMM module for the module and a serparate Android specific module for Android UI? Like:
    :feature1
     :feature1KMM
    ?? Thanks in advance.
    • 1
    • 1
  • s

    Shalom Halbert

    03/23/2021, 9:45 PM
    Is there a way to create a PR? Figured it’s worth contributing something as small as removing references to Jcenter
    r
    j
    • 3
    • 5
  • m

    Martins Iroka

    04/16/2021, 11:40 AM
    Hello, I cloned the repo and ran both android and ios from android studio. But when I try to run it from xcode, I get an error found in the image attached.
    r
    c
    • 3
    • 5
  • w

    wellingtoncosta

    05/28/2021, 7:28 PM
    Hi all! Thanks @Erik Zambrano for inviting me to this channel!
    e
    b
    • 3
    • 3
  • l

    Lena Stepanova

    06/11/2021, 1:35 PM
    2021-06-11 15:15:27.627354+0200 TomE[409:67089] Debug: (DatabaseHelper) Getting all trackings from database
    org.koin.core.error.InstanceCreationException: Could not create instance for [Single:'de.comp.proj.shared.ktor.TrackingKtorApi']
      at 0  shared               0x00000001034297f8 kfun:kotlin.Exception#<init>(kotlin.String?;kotlin.Throwable?){} + 120
      at 1  shared               0x000000010380ccc0 kfun:org.koin.core.error.InstanceCreationException#<init>(kotlin.String;kotlin.Exception){} + 120
      at 2  shared               0x000000010380e134 kfun:org.koin.core.instance.InstanceFactory#create(org.koin.core.instance.InstanceContext){}1:0 + 1472
      at 3  shared               0x000000010380e840 kfun:org.koin.core.instance.SingleInstanceFactory#create(org.koin.core.instance.InstanceContext){}1:0 + 268
      at 4  shared               0x000000010380ed0c kfun:org.koin.core.instance.SingleInstanceFactory.get$lambda-0#internal + 208
      at 5  shared               0x000000010380edb8 kfun:org.koin.core.instance.SingleInstanceFactory.$get$lambda-0$FUNCTION_REFERENCE$244.invoke#internal + 72
      at 6  shared               0x000000010380ef1c kfun:org.koin.core.instance.SingleInstanceFactory.$get$lambda-0$FUNCTION_REFERENCE$244.$<bridge-UNN>invoke(){}#internal + 68
      at 7  shared               0x0000000103829608 kfun:org.koin.mp.KoinPlatformTools#synchronized(kotlin.Any;kotlin.Function0<0:0>){0§<kotlin.Any?>}0:0 + 232
      at 8  shared               0x000000010380eae8 kfun:org.koin.core.instance.SingleInstanceFactory#get(org.koin.core.instance.InstanceContext){}1:0 + 364
      at 9  shared               0x0000000103815cf4 kfun:org.koin.core.registry.InstanceRegistry#resolveInstance(kotlin.String;kotlin.Function0<org.koin.core.parameter.DefinitionParameters>?){0§<kotlin.Any?>}0:0? + 508
      at 10 shared               0x000000010381f090 kfun:org.koin.core.scope.Scope.resolveInstance#internal + 840
      at 11 shared               0x000000010381ecb8 kfun:org.koin.core.scope.Scope#get(kotlin.reflect.KClass<*>;org.koin.core.qualifier.Qualifier?;kotlin.Function0<org.koin.core.parameter.DefinitionParameters>?){0§<kotlin.Any?>}0:0 + 1860
      at 12 shared               0x00000001038d3c38 kfun:de.comp.proj.shared.models.GeofencingModel.<init>$<anonymous>_1-1#internal + 800
      at 13 shared               0x00000001038d4c30 kfun:de.comp.proj.shared.models.GeofencingModel.$<init>$<anonymous>_1-1$FUNCTION_REFERENCE$169.invoke#internal + 152
      at 14 shared               0x000000010345da40 kfun:kotlin.native.concurrent.FreezeAwareLazyImpl.getOrInit#internal + 748
      at 15 shared               0x000000010345e0e4 kfun:kotlin.native.concurrent.FreezeAwareLazyImpl#<get-value>(){}1:0 + 500
      at 16 shared               0x00000001038ce674 kfun:de.comp.proj.shared.models.GeofencingModel.<get-trackingApi>#internal + 276
      at 17 shared               0x00000001038d04f4 kfun:de.comp.proj.shared.models.GeofencingModel.$sendGeofencingDataCOROUTINE$51#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 460
      at 18 shared               0x00000001038d095c kfun:de.comp.proj.shared.models.GeofencingModel#sendGeofencingData(kotlin.collections.List<de.comp.proj.shared.entity.TrackingData>){} + 292
      at 19 shared               0x00000001038cfda4 kfun:de.comp.proj.shared.models.GeofencingModel.$saveGeofencingDataCOROUTINE$50#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 1668
      at 20 shared               0x000000010345114c kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 560
      at 21 shared               0x00000001035c7fd0 kfun:kotlinx.coroutines.internal#resumeCancellableWith__at__kotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>} + 2556
      at 22 shared               0x00000001035c8124 kfun:kotlinx.coroutines.internal#resumeCancellableWith$default__at__kotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?;kotlin.Int){0§<kotlin.Any?>} + 240
      at 23 shared               0x00000001035f7bc0 kfun:kotlinx.coroutines.internal.shareableInterceptedResumeCancellableWith$lambda-0#internal + 232
      at 24 shared               0x00000001035f7d78 kfun:kotlinx.coroutines.internal.$shareableInterceptedResumeCancellableWith$lambda-0$FUNCTION_REFERENCE$466.invoke#internal + 72
      at 25 shared               0x00000001035f7edc kfun:kotlinx.coroutines.internal.$shareableInterceptedResumeCancellableWith$lambda-0$FUNCTION_REFERENCE$466.$<bridge-UNN>invoke(){}#internal + 68
      at 26 shared               0x000000010345cdd4 WorkerLaunchpad + 192
      at 27 shared               0x0000000103a7a330 _ZN6Worker19processQueueElementEb + 2364
      at 28 shared               0x0000000103a7d980 Kotlin_Worker_processQueueInternal + 116
      at 29 shared               0x000000010345f780 kfun:kotlin.native.concurrent.Worker#processQueue(){}kotlin.Boolean + 60
    Caused by: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen de.comp.proj.shared.ktor.TrackingApi@82553128
      at 0  shared               0x000000010343145c kfun:kotlin.Throwable#<init>(kotlin.String?){} + 96
      at 1  shared               0x0000000103429750 kfun:kotlin.Exception#<init>(kotlin.String?){} + 92
      at 2  shared               0x00000001034299c0 kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 92
      at 3  shared               0x000000010345bca4 kfun:kotlin.native.concurrent.InvalidMutabilityException#<init>(kotlin.String){} + 92
      at 4  shared               0x000000010345d0a0 ThrowInvalidMutabilityException + 336
      at 5  shared               0x0000000103a6404c MutationCheck + 156
      at 6  shared               0x00000001038b7e24 kfun:de.comp.proj.shared.ktor.TrackingApi#<init>(co.touchlab.kermit.Kermit){} + 472
      at 7  shared               0x000000010385d720 kfun:de.comp.proj.shared.coreModule$lambda-8$lambda-2#internal + 652
      at 8  shared               0x0000000103860754 kfun:de.comp.proj.shared.$coreModule$lambda-8$lambda-2$FUNCTION_REFERENCE$65.invoke#internal + 188
      at 9  shared               0x000000010380ded0 kfun:org.koin.core.instance.InstanceFactory#create(org.koin.core.instance.InstanceContext){}1:0 + 860
      at 10 shared               0x000000010380e840 kfun:org.koin.core.instance.SingleInstanceFactory#create(org.koin.core.instance.InstanceContext){}1:0 + 268
      at 11 shared               0x000000010380ed0c kfun:org.koin.core.instance.SingleInstanceFactory.get$lambda-0#internal + 208
      at 12 shared               0x000000010380edb8 kfun:org.koin.core.instance.SingleInstanceFactory.$get$lambda-0$FUNCTION_REFERENCE$244.invoke#internal + 72
      at 13 shared               0x000000010380ef1c kfun:org.koin.core.instance.SingleInstanceFactory.$get$lambda-0$FUNCTION_REFERENCE$244.$<bridge-UNN>invoke(){}#internal + 68
      at 14 shared               0x0000000103829608 kfun:org.koin.mp.KoinPlatformTools#synchronized(kotlin.Any;kotlin.Function0<0:0>){0§<kotlin.Any?>}0:0 + 232
      at 15 shared               0x000000010380eae8 kfun:org.koin.core.instance.SingleInstanceFactory#get(org.koin.core.instance.InstanceContext){}1:0 + 364
      at 16 shared               0x0000000103815cf4 kfun:org.koin.core.registry.InstanceRegistry#resolveInstance(kotlin.String;kotlin.Function0<org.koin.core.parameter.DefinitionParameters>?){0§<kotlin.Any?>}0:0? + 508
      at 17 shared               0x000000010381f090 kfun:org.koin.core.scope.Scope.resolveInstance#internal + 840
      at 18 shared               0x000000010381ecb8 kfun:org.koin.core.scope.Scope#get(kotlin.reflect.KClass<*>;org.koin.core.qualifier.Qualifier?;kotlin.Function0<org.koin.core.parameter.DefinitionParameters>?){0§<kotlin.Any?>}0:0 + 1860
      at 19 shared               0x00000001038d3c38 kfun:de.comp.proj.shared.models.GeofencingModel.<init>$<anonymous>_1-1#internal + 800
      at 20 shared               0x00000001038d4c30 kfun:de.comp.proj.shared.models.GeofencingModel.$<init>$<anonymous>_1-1$FUNCTION_REFERENCE$169.invoke#internal + 152
      at 21 shared               0x000000010345da40 kfun:kotlin.native.concurrent.FreezeAwareLazyImpl.getOrInit#internal + 748
      at 22 shared               0x000000010345e0e4 kfun:kotlin.native.concurrent.FreezeAwareLazyImpl#<get-value>(){}1:0 + 500
      at 23 shared               0x00000001038ce674 kfun:de.comp.proj.shared.models.GeofencingModel.<get-trackingApi>#internal + 276
      at 24 shared               0x00000001038d04f4 kfun:de.comp.proj.shared.models.GeofencingModel.$sendGeofencingDataCOROUTINE$51#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 460
      at 25 shared               0x00000001038d095c kfun:de.comp.proj.shared.models.GeofencingModel#sendGeofencingData(kotlin.collections.List<de.comp.proj.shared.entity.TrackingData>){} + 292
      at 26 shared               0x00000001038cfda4 kfun:de.comp.proj.shared.models.GeofencingModel.$saveGeofencingDataCOROUTINE$50#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 1668
      at 27 shared               0x000000010345114c kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 560
      at 28 shared               0x00000001035c7fd0 kfun:kotlinx.coroutines.internal#resumeCancellableWith__at__kotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>} + 2556
      at 29 shared               0x00000001035c8124 kfun:kotlinx.coroutines.internal#resumeCancellableWith$default__at__kotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?;kotlin.Int){0§<kotlin.Any?>} + 240
    r
    • 2
    • 11
  • r

    Rak

    07/14/2021, 2:29 PM
    I am about to try out KampKit as the foundation for our KMM project, should I use AS 4.2.2 or the latest Bumblebee release?
    r
    • 2
    • 1
  • r

    Robert Veres

    08/12/2021, 7:32 AM
    Hi, I’m quite new to Android and Swift, but I have a basic Android and Swift app built on Firebase Firestore. I’m thinking about using KampKit for my project, but haven’t been able to run the demo project. I have a M1 Mac, it seems the errors I get are related to that. Is there somewhere a guide how to configure KampKit to work well on M1? Thanx a lot.
    t
    r
    • 3
    • 3
  • m

    MarkRS

    08/12/2021, 3:49 PM
    Why are KaMPKit/shared/src/androidMain/kotlin/co/touchlab/kampkit/*PlatformAndroid.kt* and KaMPKit/shared/src/iosMain/kotlin/co/touchlab/kampkit/*PlatformiOS.kt identical?* Doesn't this mean they could/should be in commonMain? Or does this mean I've misunderstood something fundamental?
    r
    • 2
    • 2
  • m

    MarkRS

    08/13/2021, 2:36 PM
    The iOS "Foundation" imports in KaMPKit are written just like that, "import Foundation", but as I'm writing code AS is creating the imports as "import platform.Foundation". Have I got something (else) wrong?
    r
    • 2
    • 1
  • m

    MarkRS

    08/20/2021, 1:14 PM
    I notice you don't have the recommended "PackageForXCode" Gradle task and I don't see how the XCode stuff can be generated by what you do have. Is the development pod manually generated? Trying to use KaMPKit as an example my own project has XCode complain that it doesn't know how to build the native target 😞
    r
    p
    • 3
    • 5
  • m

    MarkRS

    09/30/2021, 1:15 PM
    Quiet in here, eh? 🙂 Do yous guys use Intellij? I ask because (I'm using AS, and) I notice your gradle wrapper file specifies gradle-7.1-all.zip , which seems to work on AS, but then again it's just asked me if I want to upgrade from 7.0.1.... which seems odd.
    r
    • 2
    • 8
  • r

    Rak

    10/19/2021, 1:03 PM
    Hi, just created my first project using the Kampkit. Android builds fine and launches but iOS complains with the message: Showing Recent Messages An exception occurred applying plugin request [id: ‘com.android.application’]
    Failed to apply plugin ‘com.android.internal.application’.
      > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.    You can try some of the following options:     - changing the IDE settings.     - changing the JAVA_HOME environment variable.     - changing
    org.gradle.java.home
    in
    gradle.properties
    . JAVA_HOME is set to java 11 so not sure what to do. This is when i try to run from XCode.
    f
    r
    • 3
    • 6
  • r

    Rak

    10/20/2021, 8:24 AM
    Hi, not sure if this a question for this channel or Koin but going through the code, I noticed that constructor injection is NOT used and instead by inject and inheriting from KoinComponent. Is there a reason for this? I have always tried to restrict the use of framework classes in my code and in my other (non KMM) projects, Koin was used via constructor injection
    r
    • 2
    • 4
  • k

    Kirill Langer

    10/20/2021, 4:29 PM
    Hi. I'm trying to build the KaMPKit project for iOS in xcode but the build keeps failing with this error:
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin//libclang_rt.ios.a, missing required architecture x86_64 in file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin//libclang_rt.ios.a (4 slices)
    Any idea what this means? I have tried deleting and reinstalling
    Pods
    with no success so far.
    k
    • 2
    • 3
  • r

    Rak

    10/21/2021, 1:22 PM
    Hi, I have setup KampKit and started to add my own request. In Android Studio I can see the changes but when I switch to XCode and run the app, the changes have not propogated. Is there something I need to do in XCode to see the latest code?
    r
    k
    • 3
    • 34
  • r

    Rak

    11/01/2021, 4:01 PM
    Hi, I am going through the tests to see how they work. The BreedModelTest runs and passes without a device or emulator, how is this possible when it needs a database?
    r
    • 2
    • 4
  • r

    Rak

    11/02/2021, 9:58 AM
    Hi, is it ok to use the project for prod code? Or is it meant to be a playground to try things and then create your own KMM project?
    r
    • 2
    • 1
  • r

    Rak

    11/08/2021, 10:35 AM
    Hi, there is a todo about using the mock engine for testing the network calls. I could really do with it but I’m stuck on working out how to swap out the engine. Specifically, what do I pass to iOS?
    r
    • 2
    • 2
  • r

    Rak

    11/09/2021, 4:36 PM
    Hi, so I have failing tests when running on the command line for iOS. They work fine in the IDE. The tests are checking the correct exceptions are being thrown. Any ideas?
    • 1
    • 2
  • r

    Rak

    11/10/2021, 7:14 AM
    Here’s the output from running the test in the IDE: 07:12 Executing tasks: [cleanIosTest, iosTest] in project /Users/rakesh.patel/StudioProjects/kmm/fluffy-guacamole/shared 07:12 Gradle build finished in 2 s 451 ms 07:12 Tests passed: 4 07:12 Tests passed: 4 07:12 Tests passed: 4 07:12 Tests passed: 4
    • 1
    • 1
  • a

    aiidziis

    11/10/2021, 3:06 PM
    Hey! Is
    co.touchlab:kermit-crashlytics:0.1.9
    published? When trying to reference it I get:
    Could not GET '<https://kotlin.bintray.com/kotlinx/co/touchlab/kermit-crashlytics/0.1.9/kermit-crashlytics-0.1.9.pom>'. Received status code 403 from server: Forbidden
    Or is it published in different repository?
    m
    k
    • 3
    • 15
  • r

    Rak

    11/10/2021, 7:25 PM
    Hi, a final update on my issues with running tests for iOS in the IDE vs command line. I rewrote my code to not rely on throwing exceptions across methods (and instead use the Result class) and I no longer have any issues. I don’t know why I had this problem. If i get time I will try and create a github repo that replicates the issue.
    r
    b
    • 3
    • 6
  • r

    Rak

    11/16/2021, 8:23 AM
    HI, is
    // Revert to just ios() when gradle plugin can properly resolve it
    still an issue?
    r
    • 2
    • 1
  • s

    saket

    11/16/2021, 4:50 PM
    q for touchlab folks: do you recommend disposing iso-collections to avoid memory leaks? I noticed this section under `stately-isolate`:
    You must dispose of IsolateState instances to avoid memory leaks.
    r
    • 2
    • 7
Powered by Linen
Title
s

saket

11/16/2021, 4:50 PM
q for touchlab folks: do you recommend disposing iso-collections to avoid memory leaks? I noticed this section under `stately-isolate`:
You must dispose of IsolateState instances to avoid memory leaks.
r

russhwolf

11/16/2021, 5:40 PM
I'm not sure we expose an API to enable that. But maybe we should. I believe the thing you want to avoid leaking is the
StableRef
inside
StateHolder
, but I don't think any of the collections expose a way to clear it. Are you having specific issues or just looking for best practice? Kevin knows that stuff much better than me but he's on vacation.
Oops slack ate my link. This stableref: https://github.com/touchlab/Stately/blob/main/stately-isolate/src/nativeCommonMain/kotlin/co/touchlab/stately/isolate/Platform.kt#L13
s

saket

11/16/2021, 6:35 PM
Are you having specific issues or just looking for best practice?
best practice! I've been using iso collections in my project but I never dispose them. I'm now thinking if that's something I should be doing. this discussion originally started here where I'm trying to convince @evant to use iso collections in kotlin-inject: https://github.com/evant/kotlin-inject/issues/167#issuecomment-970449637
r

russhwolf

11/16/2021, 6:47 PM
hm. It's a tough thing to invest a lot in right now with the new memory model on the horizon. One thing to watch out for: the new model still respects
freeze()
calls that exist in your code. So that's probably why you still see
InvalidMutabilityException
.
For possible workarounds take a look at https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#unexpected-object-freezing
I don't know that I'd want to ship that yet though
s

saket

11/16/2021, 8:38 PM
Yeah that's fair. I was under the impression that iso-collections are a drop-in solution.
View count: 3