hello guys, anyone having problems with KMP projec...
# multiplatform
m
hello guys, anyone having problems with KMP project build with last version of XCode:
Copy code
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
k
Which version, and do you have more info on the error?
m
Copy code
Run tool: konanc with args: -g -ea -target ios_x64 -p program -o /Users/magnumrocha/personal/FirestoreKMP/firestore/build/bin/iosX64/debugTest/test.kexe -l /Users/magnumrocha/personal/FirestoreKMP/firestore/build/classes/kotlin/iosX64/main/firestore.klib -l /Users/magnumrocha/personal/FirestoreKMP/firestore/build/classes/kotlin/iosX64/main/firestore-cinterop-firebasecore.klib -l /Users/magnumrocha/personal/FirestoreKMP/firestore/build/classes/kotlin/iosX64/main/firestore-cinterop-firestore.klib -l /Users/magnumrocha/.gradle/caches/modules-2/files-2.1/co.touchlab/stately-concurrency-iosx64/1.0.0-a2/d9969fb66e1adf3af907542505a1cf539cffd634/stately-concurrency.klib -l /Users/magnumrocha/.gradle/caches/modules-2/files-2.1/co.touchlab/stately-common-iosx64/1.0.0-a2/7691dfcf2ce5966c399ea35156f91513cce4112e/stately-common.klib -l /Users/magnumrocha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.3.4/b20cf69ed91067cafc92de1370c3454bf5486f3e/kotlinx-coroutines-core.klib -l /Users/magnumrocha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.14.2/4ffadf6de19bb85119f3b23f258df699548ce6fc/atomicfu.klib -l /Users/magnumrocha/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.14.2/738dbcaec956f484ff7bc08bcc159110d1c4c29a/atomicfu-cinterop-interop.klib -Xcache-directory=/Users/magnumrocha/.konan/kotlin-native-macos-1.3.70/klib/cache/ios_x64-gSTATIC -Xcache-directory=/Users/magnumrocha/.konan/kotlin-native-macos-1.3.70/klib/cache/ios_x64-gSTATIC/stately-common-iosx64/1.0.0-a2/bbee20f8cf8ff54ccfd7c4ddcbee7c83b057f8ef1ed189fa116eccce2fc5e1b2 -Xcache-directory=/Users/magnumrocha/.konan/kotlin-native-macos-1.3.70/klib/cache/ios_x64-gSTATIC/stately-concurrency-iosx64/1.0.0-a2/8a9cb70726c64491f0d25406228bb1cb9213f9fd86a2e3ff2390f102ff6baa8a -Xcache-directory=/Users/magnumrocha/.konan/kotlin-native-macos-1.3.70/klib/cache/ios_x64-gSTATIC/kotlinx-coroutines-core-iosx64/1.3.4/1eb8924e8ae0876ba3dae2038381e30abe0a4795366db686f3b759b688566e9f -Xcache-directory=/Users/magnumrocha/.konan/kotlin-native-macos-1.3.70/klib/cache/ios_x64-gSTATIC/atomicfu-iosx64/0.14.2/206c16be8b7648a6fb23739fb0f127d9db6f002838bc95a8333d1ddb4c68509f -tr -linker-option -L/usr/local/opt/curl/lib -linker-option -I/usr/local/opt/curl/include -linker-option -lcurl -Xmulti-platform -no-endorsed-libs -Xinclude=/Users/magnumrocha/personal/FirestoreKMP/firestore/build/classes/kotlin/iosX64/test/firestore_test.klib
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
it's a project of yours @kpgalligan 😅
k
Yeah, saw that
What version of Kotlin?
m
1.3.70, I've made the update of the project
to last kotlin version and gradle plugins versions
the gradle task failing is:
Copy code
> Task :firestore:linkDebugTestIosX64 FAILED
k
Are you actually building FirestoreKMP? If so, stately and coroutines versions need updates to 1.3.70 as well
m
hummm
last versions of those libraries are not in the kotlin last version yet...
is that?
k
coroutines should be 1.3.4
m
yes, it is
Copy code
ext.versions = [
            'minSdk': 9,
            'compileSdk': 28,

            'kotlin': '1.3.70',

            'androidPlugin': '3.4.1',
            'androidTools': '29.0.1',

            'firebaseCoreIos': '6.0.2',
            'firebaseFirestoreIos': '1.3.2',
            'firebaseCoreAndroid': '17.0.1',
            'firebaseFirestoreAndroid': '20.1.0',

            'stately': '1.0.0-a2',
            'coroutines': '1.3.4'
    ]
I've set stately to version
1.0.0-a2
k
Stately organization changed. You’ll probably need to include some other dependencies
m
Copy code
implementation "co.touchlab:stately-common:${versions.stately}"

implementation "co.touchlab:stately-concurrency:${versions.stately}"
k
Yeah, OK. That looks right
m
I did that
k
Hmm. You’re running one of those test projects? I haven’t looked at this in a long time. Which module are you running?
m
I am running the firestorebuild task
just to build the library
Copy code
> Task :firestore:linkDebugFrameworkIosArm64 UP-TO-DATE
> Task :firestore:linkDebugFrameworkIosX64 UP-TO-DATE
> Task :firestore:linkReleaseFrameworkIosArm64 UP-TO-DATE
> Task :firestore:linkReleaseFrameworkIosX64 UP-TO-DATE
> Task :firestore:compileKotlinMetadata UP-TO-DATE
> Task :firestore:metadataMainClasses UP-TO-DATE
> Task :firestore:metadataJar UP-TO-DATE
> Task :firestore:assemble UP-TO-DATE
> Task :firestore:iosX64ProcessResources NO-SOURCE
> Task :firestore:iosX64MainKlibrary UP-TO-DATE
> Task :firestore:compileTestKotlinIosX64 UP-TO-DATE

> Task :firestore:linkDebugTestIosX64 FAILED
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
this is very strange
the linking tasks for the Frameworks runs nicely
but the Test one is failing
k
Building now…
m
👍 nice
k
Ah! It’s probably because the compiler now runs iOS tests automatically, and they won’t work out of the box. It used to not do that.
m
hummm
another thing, on
firebase-test
module
I had to comment the lines
Copy code
iosX64("ios") {
    //binaries.getFramework("DEBUG")
    //        .freeCompilerArgs.add("-tr")
}
in the build.gradle file
because
freeCompilerArgs
is not mutable anymore
k
I’ll look at that later. I think in that case we’re running tests from Xcode, and ‘-tr’ is needed for that, but let’s worry about the first issue
m
sure
just aa info, I've update the gradle of the project to version 5.6.4 😁
k
Right now I can’t get the cinterop to resolve. It’s being generated, but the build can’t find it
I don’t know if any of that config has changed between kotlin versions
So, in summary, to build `firestore`with gradle, just add -x check to the build command. That will suppress the automated ios tests (which didn’t run in 1.3.50)
m
let me try
k
To get
firebase-test
to run, you’ll definitely need
-tr
, so maybe try
Copy code
iosX64("ios"){
        compilations.main {
            it.kotlinOptions.freeCompilerArgs += ["-tr"]
        }
    }
👌 1
Let me know how all that goes. I’m having other weird issues, but not really “working” today, so can’t really dive into it
m
yes, with
-x check
the build works
k
Cool. See how that all works for you. If possible, push fork so I can see changes.
m
alright, thank you for your support @kpgalligan 👌
👍 1