Integrate AppLovin With swift xcode 6.4 - ios

I want to integrate AppLovin With Xcode 6.4 and swift. I am Following the steps which are given in Documentation. I have added Headers and libAppLovinSdk.a Library in my project. Then I have added all the frameworks which are needed and added AppLovin SDK key into info.plist file. Then I have initialized ALSdk.initializeSdk() in Appdelegate.h file and I have added Bridging file in my project. Then I wrote -Objc in "Other Linker Flags"
I am getting this error
ld: 150 duplicate symbols for architecture i386 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
EDIT:
This is the error log.

Based on the linker errors (duplicate symbol _llvm.embedded.module) as well as the fact that you're using an older Xcode version, it may likely be a conflict/mismatch between the target/compiler of your project and the dependency. This isn't inherent to AppLovin, but can happen if the static library you're using is far too new or old for your Xcode version.
One possible occurrence of this is that we started compiling the library with Bitcode support, and I wouldn't be surprised if older versions of LLVM don't play nice with that.
I'd recommend pulling the latest version of libAppLovinSdk.a, and if at all possible, building using Xcode 7+.
Additionally, if you're using some dependency manager like Cocoapods or Carthage, you may have better luck directly (manually) integrating, given that they are maintained by third parties with no involvement from us.

You are initializing SDK at wrong place. At the time of didFinishLaunchingWithOptions: call, application has not been fully prepared. Try initializing it in method:
-(void)applicationDidBecomeActive:(UIApplication *)application
Also include -ObjC flag. It should solve duplicate symbols issue.

Related

Getting error: ld: framework not found Fabric for architecture armv7 in App

I have build a iOS framework eg: abc.framework. Now in abc.framework I have added FirebaseDatabase and FirebaseMessaging. The abc.framework compiles and builds properly. However when I add the abc.framework and abc.bundle in my iOS project eg: xyz.project then it is giving error "framework not found Fabric for architecture armv7". I have not added Fabric in abc.framework and not in my xyz.project. However when I remove the Firebase from the abc.framework then the error disappears from xyz.project and the project compiles and run without errors.
If anyone has encountered the same issue then please let me know how should I solve the issue. I have to integrate Firebase in abc.framework and that framework will be added in xyz.project
Nested frameworks are not allowed in IOS , it's only allowed in MacOSX , to create a frameWork it must be of a pure code , fabric is in Firebase , also framework must support all architecture armv7,64 and soon on this configured when you build it, I encountered the same situation posted in Apple forums and find that
If CocoaPods is an option for you, the recent CocoaPods 1.4.0 release has added the static framework podspec option, which enables the definition of static frameworks that allow depending upon other static frameworks like Fabric.

Duplicate symbols for architecture x86_64 using Google Sign-In SDK 4.0.1

I was stuck with this error from the past 2 days. Please Ignore if this question already exists as I don't found any solution I am posting this.
In my project I have integrated google maps sdk that is working fine. Presently i am using o-Auth request for gmail sign in, Now I want to implement Google Sign-In SDK 4.0.1.
My project was building with out errors before copying it. I followed the steps that are given in this link to copy sdk to my app. I was getting this error
ld: 108 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I use the following solutions still can't fix it:
Build Options -> Enable Bitcode -> set "No".
Remove -ObjC from Other Linker Flags.
project Target -> Build phases -> compile sources, ckeck no
duplicate files.
Make sure I haven't #imported a .m file.
Deploytarget is 6.0
Checked all solutions but didn't worked me ...Can any one suggest me how to fix this?
I have also faced same issue in implementing Google Sign-In SDK. I have not found any solution to it. But to solve this issue follow these steps.
Either you should use CocoaPods and follow the documentation you will not get these error.
If you are not using CocoaPods, then in that case follow the 'Demo Project' that comes with Google Sign-In SDK. Use all the frameworks that are used in this 'Demo Project' and also add the required libraries as in project.
Don't forget to add linker flag.
Note : I know this is not the solution, but i had to follow the 'Demo Project' to solve this issue.
For me, this error happened because somehow CocoaPods appears to have duplicated a GTMOAuth2ViewControllerTouch.m file, creating a GTMOAuth2ViewControllerTouch 2.m file and including it in the project.
pod update did not resolve. I manually deleted the file and the issue went away. After another pod update, the issue did not reappear.

Parse and AdMob in One iOS Binary?

Has anybody been able to compile and link Parse and AdMob in One iOS Binary?I get linker errors either from Parse or from AdMob depending on build settings.
Your help is much appreciated.
AdMob requires the -ObjC linker flag :"This flag causes the linker to load every object file in the library that defines an Objective-C class or category".
Parse has removed the Facebook SDK from its framework which generates the linker errors when the project is compiled with the -ObjC flag that AdMob requires.
I don't know of a way around AdMob's dependence on the -ObjC flag. I'm not a linker guru.
The solution Parse recommends is to add the Facebook SDK to your project. I don't know of a workaround to this either if you don't plan to use Facebook.
Parse has a support discussion here: https://www.parse.com/questions/i-dont-want-to-use-facebook-in-my-app
Update: I tried replacing -ObjC linker flag with -forceload of the AdMob library. However, I got the AdMob crash. It's the same one you get with the missing -ObjC linker flag. Any linker experts know how to replace the -ObjC with something that targets only the AdMob library?
Update 2: I needed to revisit this after upgrading to XCode 6, iOS 8, and a new version of adMob. I got it to work by using this -force_load:
-force_load $(SRCROOT)/.../GoogleMobileAdsSdkiOS/libGoogleAdMobAds.a
In my case, I have adMob installed inside of subfolders of my project source. Just substitute ... with your relative path to the adMob SDK.
Looks like following flag solve the problem:
-force_load Libraries/GoogleAdMobAdsSdkiOS-6.8.0/libGoogleAdMobAds.a

Upgrading Google Mobile Ads iOS SDK from 5.0.5 to 6.4.2 results in linker errors

I have an existing iOS app that is using Google Mobile Ads SDK (v 5.0.5, I believe). I need to upgrade it to the latest version for DoubleClick support. However, I'm getting linker errors.
My steps were as follows:
Remove file references for previous SDK from project
Remove previous libGoogleAdMobAds.a linked library
Follow the setup instructions (to the letter, including the required frameworks, including only the specific files, as well as adding the Other Linker Flag)
The specific error is:
Undefined symbols for architecture i386:
"_CGSizeFromGADAdSize", referenced from
or
"_kGADAdSizeBanner", referenced from
What else am I missing?
Maybe you need the -all_load linker flag option too? According to this article it's obsolete for newer ARM7 targets, but perhaps you have an old target?
http://vntin.com/feeds.feedburner.com/blogspot/LTiVe
See under this section: "Support for armv7s"
"If you’re targeting the armv7s architecture, you will not need to add the -all_load linker flag to your projects anymore. "
[Update]
You can try to verify what's in the lib*.a file by using the nm command.
nm -U libGoogleAdMobAds.a | grep kGADAdSizeBanner
Also, clicking on the Log Navigator may provide some additional information. Select the last icon then your last build in the left nav.
[Update 2]
Someone on this site also complained about a linker problem with the new API. Might have to make small changes to your code.
http://www.monkeycoder.co.nz/Community/posts.php?topic=1246
Something has changed in the latest AdMob SDK. I get the same linker error. I can use an older version of the SDK and this all works fine. Anyone know what could have changed with Ad sizes?
EDIT: Found the problem. There were some name changes to constants :)
https://developers.google.com/mobile-ads-sdk/docs/ios/intermediate
Change the GAD_ ad sizes with:
kGADAdSizeBanner.size.width and kGADAdSizeBanner.size.height

Error while integrating Google Analytics SDK (GoogleAnalyticsiOS_2.0beta4) in my iOS app

I am getting following error
duplicate symbol _OBJC_METACLASS_$_GAIDispatcher in:
/Shared/ThirdParty/Analytics/libGoogleAnalytics.a(GAIDispatcher.o)
/Shared/ThirdParty/Analytics/libGoogleAnalytics_debug.a(GAIDispatcher.o)
ld: 212 duplicate symbols for architecture armv7 clang: error:
linker command failed with exit code 1 (use -v to see invocation)
I am using coredata in my app and I have linked all the frameworks as mentioned in the doc.
Also, I am compiling my app using Xcode 4.5.2.
A possible duplicate Qs could be (The Google Analytics SDK for iOS isn't built for the armv7s architecture while instaling app on iPhone) .
But, I am not using Analytic v1.5.1. I am using version 2(beta).
The problem you're seeing is because you have two Google Analytics libraries being included in your built product. The non-Debug version and the Debug version.
You need to settle on and simply use one of them. Take the non-used one out of your project or uncheck the target's "membership" checkbox in the file inspector for that unwanted library.
The checkbox I'm talking about is seen below. Instead of "UIKit.framework" (which I quickly selected to make this example), look for one of the two Google Analytics libraries and turn it off.

Resources