I'm running into a unrecognised selector error as my App is resolving the wrong library when calling a method in runtime.
What:
I'm using Reachability
and a private framework, we'll say FooLib
I get the following runtime warning - before the method is called
Class Reachability is implemented in both
.../Frameworks/Reachability.framework/Reachability(0x106590d18)
and.../Frameworks/FooLib.framework/FooLib(0x10628d6b8)
One of the two will be used. Which one is undefined.`
FooLib
has no dependencies to Reachability
, nor does its sub dependencies, nor does it mention the word Reachability ever.
FooLib
when calling a Reachability
function
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[Reachability reachabilityForLocalWiFi]: unrecognized selector sent to class 0x10628d6b8'
Podfile
App
, and my FooLib
have:
use_frameworks!
Attempts:
Does anyone have an idea whats going on? Any insight would be much appreciated.
Ok, this is just a guess, I'll remove the answer if it turns out to be complete bullshit...
Apple deprecated - and maybe just have removed - the method reachabilityForLocalWiFi
.
So it could be that your pods just import old header files, which satisfy the compiler, but at runtime, the function does not exist anymore, hence the unrecognized selector exception.
You could just try the suggestions from the linked Apple Readme.md
Nevertheless, it would be interesting to find out if this really is the reason, and why the podfiles "misbehave" in that way.