<@UMCJ3C57V> I will pushed a first alpha and test ...
# koin-contributors
a
@John O'Reilly I will pushed a first alpha and test with your MP projects 👍
👍 1
j
Does this version allow use in both KMP shared code and in Compose?
Some of my repos currently used 3.x version that had KMP support (but I don't believe worked with compose).....others have it the other way around.
If it supports both then I'll update all repos to use this version
a
yes, compose will be there also (and more independant to allow more version update)
let me repush it 👍
j
@arnaud.giuliani I wasn't fully clear from above.....should there be a 3.0.1 version available somewhere now?
a
3.0.1-alpha-1 is available
I just don’t know for the native part
you have 2 implementation for Junit: koin-test-junit4 & koin-test-junit5
j
just took quick look at pulling in
3.0.1-alpha-1
- looks like artifact for following is missing https://dl.bintray.com/ekito/koin/org/koin/koin-androidx-viewmodel/ ?
a
no need anymore
koin-android get all main features
just keep external unstable features
j
ah, cool
a
as Android Scope can be also based on ViewModel, best is to keep one consistent aretefact
j
next thing I'm seeing is
Unresolved reference: KoinComponent
Has that changed in this version?
a
it has been moved
package renaming org.koin.core.component
j
Thanks, AS canary not behaving here and isn't giving usual prompt for where to import it from
👍 1
a
arf 😕
KoinComponent is just asking for OptIn, as it’s consiedered as extending the Koin runtime API
let me know if you need more help
j
Trying out with PeopleInSpace. Everything looks good so for Android and Compose desktop clients......for iOS, I'm getting following which I guess relates to what you mentioned above
Copy code
Could not resolve org.koin:koin-test:3.0.1-alpha-1.
Should this be different dependency now?
actually, getting
Could not resolve org.koin:koin-core:3.0.1-alpha-1
as well....re-reading above sounded like native dependencies weren't actually in place yet?
a
Perhaps my native gradle config is not good 🤔
I ping you for next alpha
👍 1
@John O'Reilly
alpha-2
is out 👍
j
cool, will give it a go shortly
getting
Could not resolve org.koin:koin-test:3.0.1-alpha-2
when building iOS app
This is using simulator (iosX64)
hmm, seems like it should be there (from https://dl.bintray.com/ekito/koin/org/koin/)
Copy code
koin-test-iosarm32/
koin-test-iosarm64/
koin-test-iosx64/
a
arf ... same metadata glitch in koin-test 🥔 🤦
should be quick then 👍
j
Copy code
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception: kotlin.UnsupportedOperationException
    at 0   PeopleInSpaceSwiftUI                0x000000010bffcbd3 kfun:kotlin.Throwable#<init>(){} + 67
    at 1   PeopleInSpaceSwiftUI                0x000000010bff50fc kfun:kotlin.Exception#<init>(){} + 60
    at 2   PeopleInSpaceSwiftUI                0x000000010bff536c kfun:kotlin.RuntimeException#<init>(){} + 60
    at 3   PeopleInSpaceSwiftUI                0x000000010bff5c8c kfun:kotlin.UnsupportedOperationException#<init>(){} + 60
    at 4   PeopleInSpaceSwiftUI                0x000000010bff6c75 kfun:kotlin#lazy(kotlin.LazyThreadSafetyMode;kotlin.Function0<0:0>){0§<kotlin.Any?>}kotlin.Lazy<0:0> + 629
    at 5   PeopleInSpaceSwiftUI                0x000000010bef7862 kfun:com.surrus.common.repository.PeopleInSpaceRepository#<init>(){} + 818
    at 6   PeopleInSpaceSwiftUI                0x000000010bf0bfb5 objc2kotlin.119 + 165
    at 7   PeopleInSpaceSwiftUI                0x000000010bed97ff $sSo29CommonPeopleInSpaceRepositoryCABycfC + 31
    at 8   PeopleInSpaceSwiftUI                0x000000010bed97c7 $s20PeopleInSpaceSwiftUI11ContentViewV07_peoplebcG5Model33_F066A1E5F55160DDF59ED87783CA7A0ALL0dE011StateObjectVyAA0abcgI0CGvpfiAJycfu_AJycfu0_ + 55
    at 9   SwiftUI                             0x00007fff570287c5 $s7SwiftUI11StateObjectV3Box33_26399901AD247149EF526863F9AAF7C4LLV6update8property5phaseSbACyxGz_AA12_GraphInputsV5PhaseVtF + 85
    at 10  SwiftUI                             0x00007fff5752e95c $s7SwiftUI9BoxVTable33_68550FF604D39F05971FE35A26EE75B0LLC6update3ptr8property5phaseSbSv_SvAA12_GraphInputsV5PhaseVtFZ + 204
    at 11  SwiftUI                             0x00007fff5752e05f $s7SwiftUI22_DynamicPropertyBufferV6update9container5phaseSbSv_AA12_GraphInputsV5PhaseVtF + 63
    at 12  SwiftUI                             0x00007fff571de0e1 $s7SwiftUI11DynamicBodyV11updateValueyyF + 257
    at 13  SwiftUI                             0x00007fff56ed9d8a $s14AttributeGraph0A0VyACyxGqd__c5ValueQyd__RszAA12StatefulRuleRd__lufcADSPyqd__GXEfU_ySv_So11AGAttributeatcyXEfU_ySv_AJtcqd__mcfu_ySv_AJtcfu0_TA + 26
    at 14  AttributeGraph                      0x00007fff4c92c723 _ZN2AG5Graph11UpdateStack6updateEv + 505
    at 15  AttributeGraph                      0x00007fff4c92cbb9 _ZN2AG5Graph16update_attributeENS_4data3ptrINS_4NodeEEEb + 335
    at 16  AttributeGraph                      0x00007fff4c93185f _ZN2AG5Graph20input_value_ref_slowENS_4data3ptrINS_4NodeEEENS_11AttributeIDEjPK15AGSwiftMetadataPbl + 523
    at 17  AttributeGraph                      0x00007fff4c942dc5 AGGraphGetValue + 203
    at 18  SwiftUI                             0x00007fff570c50a7 $s7SwiftUI8MakeBody33_47701A835A1B253AFF3923CF965CEFD6LLV4viewxvg + 23
    at 19  SwiftUI                             0x00007fff570c50f9 $s7SwiftUI8MakeBody33_47701A835A1B253AFF3923CF965CEFD6LLV5value08InternalD0Qzvg + 57
    at 20  SwiftUI                             0x00007fff570c5177 $s7SwiftUI8MakeBody33_47701A835A1B253AFF3923CF965CEFD6LLVyxG14AttributeGraph4RuleAafGP5value5ValueQzvgTW + 23
    at 21  AttributeGraph                      0x00007fff4c945907 $s14AttributeGraph4RuleP5value5ValueQzvgTj + 7
    at 22  SwiftUI                             0x00007fff56c7ea18 $s14AttributeGraph0A0VyACyxGqd__c5ValueQyd__RszAA4RuleRd__lufcADSPyqd__GXEfU_ySv_So11AGAttributeatcyXEfU_ySv_AJtcqd__mcfu_ySv_AJtcfu0_ + 56
    at 23  AttributeGraph                      0x00007fff4c92c723 _ZN2AG5Graph11UpdateStack6updateEv + 505
    at 24  AttributeGraph                      0x00007fff4c92cbb9 _ZN2AG5Graph16update_attributeENS_4data3ptrINS_4NodeEEEb + 335
    at 25  AttributeGraph                      0x00007fff4c93185f _ZN2AG5Graph20input_value_ref_slowENS_4data3ptrINS_4NodeEEENS_11AttributeIDEjPK15AGSwiftMetadataPbl + 523
    at 26  AttributeGraph                      0x00007fff4c942dc5 AGGraphGetValue + 203
    at 27  SwiftUI                             0x00007fff574e964e $s7SwiftUI10IsAnimated33_118F5F06898F710FC0FEC394204027F7LLV11updateValueyyF + 62
    at 28  SwiftUI                             0x00007fff56ed9d8a $s14AttributeGraph0A0VyACyxGqd__c5ValueQyd__RszAA12StatefulRuleRd__lufcADSPyqd__GXEfU_ySv_So11AGAttributeatcyXEfU_ySv_AJtcqd__mcfu_ySv_AJtcfu0_TA + 26
    at 29  AttributeGraph                      0x00007fff4c92c723 _ZN2AG5Graph11UpdateStack6updateEv + 505
CoreSimulator 732.18.6 - Device: iPhone 11 Pro (EFD5D463-7F46-4200-A6FB-76F0997D975C) - Runtime: iOS 14.3 (18C61) - DeviceType: iPhone 11 Pro
(lldb)
so, I commented out use of
koin-test
...it builds now but getting run-time crash
also seeing similar crash in another project that wasn't actually using
koin-test
seeing
kotlin.UnsupportedOperationException
for example in both
have been trying to comment out stuff to narrow down what's causing it.......I'm using
PeopleInSpaceRepository
for example from iOS code and if I change that to not derive from
KoinComponent
then it doesn't crash
a
Why the new
KoinComponent
provoke that? 🤔
you need an optIn
@OptIn(KoinApiExtension::class)
j
tried adding that but get same crash
a
Hi @John O'Reilly, any better results lastly? Was wondering if it’s binary generation from Kotlin native
j
I didn't try since.... was there new version after that?
a
nope
I thought it was more something related to Kotlin Native binary? 🤔
j
Were you able to try Peopleinspace iOS app there?
a
I got many errors ...
retrying
not much success
j
If you get errors still let me know and I might know what's causing them....one thing to watch out for is you need to open
PeopleInSpaceSwiftUI
folder (or ..xcworkspace file) from XCode....and not the .xcodeproj file)
a
message has been deleted
I retry by opening the right
xcworkspace
file
j
ok, I think issue there is you need at least Java 11 and it's using Java 8....recent versions of Android Studio Canary (and associated plugin) now depend on having at least Java 11
a
it’s a need of rebuild from PeopleSpace ?
and Koin is JAVA_8 compat I believe
Copy code
sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
j
the issue is more with the version the gradle plugin now depends on
a
arf
thanks, I will check that
j
A bit crazy here today but happy to help out later if you need anything tested
a
Thanks John, I will take time to retry later 🙂
m
@arnaud.giuliani Sorry I know it is under development but just wanted to inform you about an issue
Copy code
const val koinCore = "org.koin:koin-core:${Versions.koin}"

const val koinAndroidViewModel = org.koin:koin-androidx-viewmodel:${Versions.koin}"
So those 2 are not sharing same version anymore core become
"3.0.1-alpha-3"
and viewModel remained
"3.0.0-alpha-4"
It is fine i applied different version for each but at that time I got runtime crash
Copy code
2021-02-05 11:39:22.799 ? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: mustafaozhan.github.com.mycurrencies, PID: 8869
    java.lang.NoSuchMethodError: No virtual method getRootScope()Lorg/koin/core/scope/ScopeDefinition; in class Lorg/koin/core/module/Module; or its super classes (declaration of 'org.koin.core.module.Module' appears in /data/app/~~1L7Hv_CFt1voXmqDk1DsSw==/mustafaozhan.github.com.mycurrencies-JL80hYuSZx5MAMe-dCkoSQ==/base.apk!classes22.dex)
        at com.github.mustafaozhan.ccc.client.di.KoinAndroidKt$clientModule$1.invoke(KoinAndroid.kt:49)
        at com.github.mustafaozhan.ccc.client.di.KoinAndroidKt$clientModule$1.invoke(Unknown Source:2)
        at org.koin.dsl.ModuleKt.module(Module.kt:31)
        at org.koin.dsl.ModuleKt.module$default(Module.kt:29)
        at com.github.mustafaozhan.ccc.client.di.KoinAndroidKt.<clinit>(KoinAndroid.kt:36)
        at com.github.mustafaozhan.ccc.client.di.KoinAndroidKt.initAndroid(Unknown Source:0)
        at com.github.mustafaozhan.ccc.android.app.CCCApplication.onCreate(CCCApplication.kt:17)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
a
koin-androidx-viewmodel is merged in koin-android in 3.0.1
👍 1
here is a list of available modules. You can see that main android modules have been merged
m
thank you for sharing i din’t know 🙂
a
still in alpha stages, just time to adjust KMP & some android fixes
👍 1