Hi, is anyone else getting a lot of warnings in th...
# multiplatform
s
Hi, is anyone else getting a lot of warnings in their iOS build after updating from Kotlin 1.7.10 to 1.7.20? In both Xcode 14.0 & 14.1b3, simulator or device, our build is totally cluttered with over 3,000 warnings in the format
(arm64) could not find object file symbol for symbol ...
after changing version. Seems like most relate to iOS code written in Kotlin, or 3rd party dependencies (Okio, SQLDelight, Koin, Apollo, NSExceptionKt).
👀 2
r
Any examples of the symbols affected?
i
I remember having thousands of those with Xcode 13 too, but interestingly enough only in Dev/Debug configuration - in Staging/Production, which were using Release configurations under the hood, were just fine, no warnings. Not sure if that helps, but may be worth building Release config and see if the warnings are still there 🙂
s
@Rick Clephas
Any examples of the symbols affected?
Copy code
<..shortened..> _kifacevtable:org.koin.core.scope.Scope.$close$lambda$11$FUNCTION_REFERENCE$94_1510013139
<..shortened..> _kifacetable:org.koin.core.scope.Scope.$close$lambda$11$FUNCTION_REFERENCE$94
<..shortened..> _kextname:org.koin.core.scope.Scope.$close$lambda$11$FUNCTION_REFERENCE$94
<..shortened..> GCC_except_table8
<..shortened..> _kclass:com.rickclephas.kmp.nsexceptionkt.core.ThrowableNSException
<..shortened..> _kobjcclassinfo:com.rickclephas.kmp.nsexceptionkt.core.ThrowableNSException
<..shortened..> _ktype:com.rickclephas.kmp.nsexceptionkt.core.$wrapUnhandledExceptionHook$lambda$0$FUNCTION_REFERENCE$0#internal
<..shortened..> _kintf:com.rickclephas.kmp.nsexceptionkt.core.ThrowableNSException
@Igor Milakovic Interesting, I’ll try and check release, thanks! Doesn’t really help for local debug builds though, where any SwiftLint or Swift compiler warnings we get are now lost in a sea of Kotlin warnings though 😅 Our app seems to run just fine with no issues at least
i
Oh for sure - emotionally speaking, it is devastating, but luckily the app works fine. 😅 Btw, here's another warning for you
warning: you've tagged the wrong Igor
😁
s
🤦‍♂️ Sorry!
i
Hahaha, I was just joking, no worries!
r
Interesting, just tried building the NSExceptionKt sample in debug config (normally builds in release to get realistic stacktraces), but I am not seeing any warnings there. How are you consuming the shared module in Xcode?
s
At the moment, as per this comment, but I’ve just tried consuming it exactly as described in the Sentry readme and still see the same warnings. Otherwise, all other dependencies we’re getting warnings for are standard Gradle
commonMain
dependencies.
r
Alright. And the KMM module? Is it consumed with CocoaPods or the embedAndSign Gradle task?
s
Ah,
embedAndSignAppleFrameworkForXcode
Gradle task executed from an Xcode Run Script build phase
r
Hmm oke, that’s also how the sample works. In case it helps, I tested this with Xcode 14.0, iPhone 14 Pro simulator (iOS 16.0) on an M1 MacBook Pro. I am not sure if you can build the NSExceptionKt sample without the need to configure Sentry (and the others), but would be good to know if it something with the setup or the project.
s
Hmm, NSExceptionKt sample does actually build with no warnings
r
@Igor Milakovic did the warnings eventually disappear? Not sure if this could be caused by some dependencies still using Kotlin 1.7.10 (I have had issues with that before, but haven’t seen this one).
i
I don't think so, but please don't take my word for it, it's been a while. Since the warnings were gone in Release configs I stopped worrying 🙂
b
Hi @Rick Clephas @Igor Milakovic I had exactly the same issue after upgrading to Kotlin 1.7.20 (ktor 2.1.2, serialization 1.4.1, kover 0.6.1). Rolling back to 1.710 (ktor 2.1.1, serialization 1.3.3, kover 0.5.1) resolves the issue. Did you have a solution/workaround?
r
No unfortunately not. So far it doesn’t seem (solely) related to the Kotlin version. It’s worth noting that both Ktor and kotlinx-kover are still using Kotlin 1.7.10.
i
Me neither, I feel like that's going to show up and go away as we go through upgrades, so no real solution at the moment. Btw, does it happen for you guys in Release configuration too?
s
Very late reply, but this doesn’t happen in Release configuration for me
r
The approach that I've taken to get around the compile warnings is to force the KMM shared framework to build for release via
xcodeConfigurationToNativeBuildType
mapping. Specifically, in build.gradle.kts, under
kotlin
> `cocopods`: xcodeConfigurationToNativeBuildType["Debug"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE
m
@Rob VS Thank you very much, this works for us!
764 Views