When upgrading to kotlin 1.4 I get an `EXC_BAD_ACC...
# ios
d
When upgrading to kotlin 1.4 I get an
EXC_BAD_ACCESS
exception in a
swizzle
method (not familiar with it, I’m an android dev 😛 ) and a stacktrace pointing to
doubleCheckOriginalClass	Class	SharedCodeio.ktor.client.engine.ios.IosResponseReader0	0x00
. Any idea what this means and how to resolve? I use all the latest versions (kotlin 1.4.0, ktor 1.4.0, coroutines 1.3.9-native-mt)
s
What iOS libraries are you using? Some of the instrumentaion types will swizzle (monkey patch) base various system level classes.
d
In the shared module the ios source set has the following dependencies:
Copy code
implementation("io.ktor:ktor-client-ios:$ktorVersion")
implementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core"){
  version {
    strictly(coroutinesVersion)
  }
}
but I guess it has something to do with the ktor ios-client?
s
Any swizzling is probably happening in your app’s dependencies. What does the podfile look like?
d
Ok, I don’t know that means, but here is the podfile:
Copy code
platform :ios, '13.0'

target 'OurApp' do
  use_frameworks!

  pod 'Lokalise', '~> 0.10.0'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Analytics'
  pod 'Firebase/Performance'
  pod 'Firebase/Messaging'
  pod 'common', :path => 'some/path'  
  pod 'Reveal-SDK', :configurations => ['Debug']

end
Do you see anything special here that can cause my issue?
s
Firebase does a lot of method swizzling but can usually be disabled in the config. Firebase Analytics swizzles methods in UIViewController to track screen appearances. Firebase Performance is likely doing some swizzling in NSURLSession to track http stats.
https://nshipster.com/method-swizzling/ is a good article on what method swizzling is. It is a thing that you find framework vendors doing to make things just magically happen. In general it is not a great thing to do but because the ObjC runtime is dynamic it is possible to do.
d
Ok, thanks for your insight. I will consult our ios devs and see what they think. 👍