I know this question has been asked before, but I've tried everything I could find and none of it has worked.
I have a fully functional iOS app, that I now want to integrate AdMob Network Mediation with. I've already successfully had just AdMob working fine, but the Mediator requires the linkers '-all_load' and '-ObjC' to be set (in Other Linker Flags). Sure enough if I build without them, no ads are shown and in the logs it says it requires them to be set.
The problem is I cannot successfully build my app with either all_load or ObjC set. I read that ObjC isn't necessary for iOS apps, but even without it I still have the problem with all_load. The problem being I get this error:
ld: duplicate symbol [some command here] [some static library] and [path to same command] for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I remove the offending static library and rebuild, the error simply moves on to the next static library I have and so on. Being that I'm trying to install an ad mediator, my app requires several static libraries from different ad networks to be in place.
Here are some solutions that I've tried that have failed:
Any help is appreciated in solving this issue.
EDIT: THE SOLUTION TO MY PROBLEM
As it turns out, the only thing I didn't try was only using -ObjC on an actual device, this seems to work for me!
EDIT2: NEVERMIND, STILL HAVING TROUBLE
I'll quote my comment below when asked what static libraries were causing me problems:
"Well I got AdMob Mediation working without any other networks by excluding the all_load and just including ObjC, which was working fine until I added my first network, Adfonic, which is currently conflicting with MobileAppTracking, I get: ld: duplicate symbol _OBJC_IVAR_$_Reachability.reachabilityRef in [path]/Adfonic SDK/libAdfonic.a(Reachability.o) and [path]/Objects-normal/armv6/Reachability.o for architecture armv6 clang: error: linker command failed with exit code 1 (use -v to see invocation)"
I had the bare bones of Admob Mediator working by deleting all other ad network libraries, but with my first third-party network integration I'm getting another conflict between that and a tracking library I have implemented, MobileAppTracking. Still looking for a solution to solve 'duplicate symbols'.
EDIT 3
I can confirm that every single ad network I try with the AdMob Mediator (except for AdMob itself) fails to compile, most of them due to duplicate symbol errors. I don't understand how this can be, as I'm sure I'm not the only one using Admob's Mediation service.
EDIT 4
I'll quote my comment below:
"I actually managed to get most of the ad networks and libraries working for me, I had to delete quite a few references under Compile Sources, but I got it compiling none-the-less, wile still using -ObjC and -all_load!"
you can use -force_load "path/to/your/libGoogleAdMobAds.a" instead of -all_load, this will load your libGoogleAdMobAds only
Please remove add-one folder in your SKD folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With