Google analytics 3.08 IOS idfa class missing, won't collect idfa - ios

I downloaded google analytics and i followed their instructions how to implement analytics in application. But whatever i tried i get this log in xcode: idfa class missing, won't collect idfa.
So i google it and found that apple will reject apps that have this warning. I also discovered that google fixed this issue with 3.03c release, and that we don't have to import library that uses ads. I have also run their example and i get same log in their example.
So my question is, will Apple approve my application, how can I fix it?

I have the same issue. It seams that 3.08 lib is linked with iAd.Framework
Here is what I did - I've rolled back to the version 3.03c. You can download it here
"https://dl.google.com/googleanalyticsservices/GoogleAnalyticsServicesiOS_3.03c.zip
The best way is to use Cocopoads for managing libraries with pod 'GoogleAnalytics-iOS-SDK', '3.0.3c'

I am using 3.0.9. I was able to remove the warning by linking in the libAdIdAccess.a library provided with the GoogleAnalytics SDK and the AdSupport.framework.

I am using the version 3.0.9 and to get rid of this warning I had to link the library libAdIdAccess.a and the AdSupport.framework manually.
To do so simply add the following lines into your build settings Other Linker Flags (OTHER_LDFLAGS) :
-framework AdSupport
-force_load "${PODS_ROOT}/GoogleAnalytics-iOS-SDK/libAdIdAccess.a"
It should look like this:
Link: Official Documentation

Just for complete other responses. I'm using the Google Analytics SDK v3.09 which I integrated without CocoaPod within Xcode 6.
In order to remove the warning, I simply added the libAdIdAccess.a static library to my project by a drag and drop.
AdSupport.framework was already included in my project.
Note: I don't know why but sometimes, Xcode is mistaken for path adding an new library by this way what is resulting into a link error. In this case just modify the path in the Library Search Path option from the Build Settings : replace $(PROJECT_DIR)/YourDirectory/GoogleAnalyticsLibrary-3.09 by "$(SRCROOT)/YourDirectory/GoogleAnalyticsLibrary-3.09"

I'm using v3.08 and get the same warning. I just submitted my app and it was approved by Apple. I think they are aware of the issue but did not enforce it in my case. You can submit your app and take the time between submission and decision to remove 3.08 and go back to 3.03c just in case they reject it.

GoogleAnalytics-iOS-SDK has been deprecated in favor of
GoogleAnalytics
so just replace the line in your pod file to
pod 'GoogleAnalytics'

All you have to do is to add libAdIdAccess.a to your project. It is part of GoogleAnalyticsServicesiOS_3.09 delivery.

pod 'GoogleIDFASupport'
That will let cocoapods get what you need. I havent had to do the force_load of it either.
Installing GoogleIDFASupport (3.14.0)
Using GoogleTagManager (3.15.0)

I'm using 3.0.3c and not using IDFA,.
Howerer, "idfa class missing" is still logged.
GAI.sharedInstance().logger.logLevel = GAILogLevel.Verbose
I solved the problem by trying to delete the line above.

I am using 3.0.9. Per Google documentation you need to set tracker.allowIDFACollection to NO on each tracker.
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
tracker.allowIDFACollection = NO;
This will remove the warning.

Related

Setting clientID for GIDSignIn in iOS app crashes

I try to use GIDSignIn in my iOS app (ObjC). But when I do
[GIDSignIn sharedInstance].clientID = GID_SIGN_IN_KEY;
in my app-delegate, I get and error unrecognized selector sent to instance.
I'm using cocoapods to load the framework
pod 'GoogleSignIn'
pod 'GTMAppAuth'
pod 'AppAuth'
I configured the URL-scheme in my info.plist as described in the docs.
I'm building the app for iOS 14.
As suggested in countless posts on the web, I load libz.tbd, SystemConfiguration.framework, StoreKit.framework, AddressBook.framework and I set -ObjC in my other linker flags.
Alas, I'm still getting this error.
Any Ideas?
So, it turns out the Google docs for the Youtube-API are outdated (again).
I had to use dependencies (github) instead of the pod-version of GIDSignIn. Then the signup-process worked.
Uploading a video was another pain in the a** since the docs use an outdated version of the GIDGoogleUser…
I will spare you my rant on Google now…

'Linker command failed with exit code 1' when using Google Analytics via CocoaPods

I'm trying to add Google Analytics to an iOS app written in Swift. I've followed the guide that adds the frameworks via CocoaPods and added a bridging header but I'm still getting:
Linker command failed with exit code 1
My podfile does have use_frameworks! so I'm wondering if that has anything to do with it... there is no additional information on the Analytics site from what I can see.
EDIT:
I've noticed that after viewing the full error message the following is displayed:
ld: '/Users/simon/Programming/VenueNow/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib.a(GTMNSData+zlib.o)' does not contain bitcode.
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
And searching for that issue brings up that Google updated to support bit code but hadn't updated the cocoa pods framework at that time.
Go to your build settings and switch the target's settings to ENABLE_BITCODE = YES for now.
I had this same issue. Fortunately you can use Google Analytics with BitCode enabled, but it's a bit confusing due to how Google had set up their CocoaPods support.
There's actually 2 CocoaPods you can use:
'Google/Analytics'
'GoogleAnalytics'
The first one is the "latest" but it's tied to the greater Google pods so it does not support Bitcode. The second one is for Analytics only and does support BitCode. However because the latter does not include extra Google pods some of the instructions on how to set it up are incorrect.
You have to use the v2 method of setting up analytics:
// Inside AppDelegate:
// Optional: automatically send uncaught exceptions to Google Analytics.
GAI.sharedInstance().trackUncaughtExceptions = true
// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
GAI.sharedInstance().dispatchInterval = 20
// Create tracker instance.
let tracker = GAI.sharedInstance().trackerWithTrackingId("XX-XXXXXXXX-Y")
The rest of the Google analytics api you can use the v3 documentation (you don't need to use v2).
The 'Google/Analytics' cocoapod as of this writing still does not support BitCode. See here
Had this issue, but it wasn't related to the bitcode setting. I had somehow ended up with duplicate framework files in the Frameworks folder of my XCode project. I deleted all frameworks files that were red (and duplicates). This solved the "Apple Mach O, Linker Command failed with exit code 1" error.
This worked for me:
you have to remove libPods.a library from Linked Frameworks and
Libraries section of target.
Make sure you open the .xcworkspace file not the project file from xCode Project menu when working with pods. That should solve the issue with linking.
Close Xcode, rename the folder. Then make a new folder with the previous name. Run the project, stop the project. Delete the new folder, rename old folder and re-run.
My iPad Pro simulator is affected with this issue. Its something that makes me upset, so much hard work... hopefully Google works through bugs for the next SDK.
When I changed 'iOS Deployment Target' from 'IOS 10.0' to current one (my phone's) 'iOS 10.2', the problem was gone for me.
Building Settings>Deployment>iOS Deployment Target
I resorted to adding Analytics via cocoa pods again and disabled bit code for now.
Hopefully a future cocoa pods version will support it.
You have another option... install Google Analytics without using CocoaPods:
https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download
I had same the problem with xcode 7.3. It is because, some of my .h and .m files were added twice.
This usually happens when using Cocoapods and you are building from the xcproject which doesn't know about the cocoapod libraries.
Some times appeared if you declare a constant in the header file without static notation.
like this
const int k = 10;
it should be:
static const int k = 10;
Try to remove any trace of cocoapods pods using pod deintegrate then
Run pod install
Build Settings > Enable Bitcode > No

Admob SDK - iOS -File not found

I have installed Google Analytics and Google AdMob SDK in my iOS project using Cocoapods. I have implemented both the functionalities in my app and everything looked okay for a week. Then suddenly, when I compiled the app, I received this error message:
"GADBannerView.h file not found". in "#import GADBannerView.h"
But I was able to see the header GADBannerView.h in my project under Pods target.
I did some research and found this error can happen due to SEARCH PATH in BUILD SETTINGS. Many faced similar issues when they moved the project from one machine to another machine but I didn't do that. So, instead of investigating on SEARCH PATH, I removed my GADBanner implementation from my project and commented line #import GADBannerView.h and my project compiled successfully.
I don't quite understand why the Google Analytics SDK is getting compiled successfully while AdMob is throwing a compilation error. I even did a pod update and still received the same error.
The SEARCH PATHS in my target is $(inherited) and ALWAYS SEARCH USER PATH is set to No
Starting at AdMob 7.0, AdMob has made the SDK a framework. Import it like so:
#import <GoogleMobileAds/GoogleMobileAds.h>
Go to: --> Build Settings --> Apple LLVM 7.1 - Language - Modules --> Enable Modules (C and Objective-C) --> set it to Yes.
According to the Google Ads Developer Blog we need to use:
#import GoogleMobileAds;
If you have a problem with the #import syntax you need to modify your project build settings. Search for Modules and set Enable Modules to YES.
First one is issue of latest SDK will not be used for Admob.
second is issue of Xcode 7.0 and you can try in Xcode xcode below 7 for till date,

App Rejected because of AdSupport [duplicate]

This was simply an update that didn't change anything to do with the rejection reason. Here is the response from the resolution center:
Reasons
Program License Agreement
PLA 3.3.12
We found your app uses the iOS Advertising Identifier but does not include ad functionality. This does not comply with the terms of the iOS Developer Program License Agreement, as required by the App Store Review Guidelines.
Specifically, section 3.3.12 of the iOS Developer Program License Agreement states:
"You and Your Applications (and any third party with whom you have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier."
Please check your code - including any third-party libraries - to remove any instances of:
class: ASIdentifierManager
selector: advertisingIdentifier
framework: AdSupport.framework
If you are planning to incorporate ads in a future version, please remove the Advertising Identifier from your app until you have included ad functionality.
To help locate the Advertising Identifier, use the “nm” tool. For information on the “nm” tool, open a terminal window and enter, “man nm.”
If you do not have access to the libraries source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool lists the methods that the library calls, and "otool -ov" will list the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.
The third party libraries I'm using is the latest version of parse.com sdk, latest version of flurry analytics, and version 2.2 of test flight. Does anybody know which library is the issue? Thanks
In Terminal:
Go to the root folder of your project
Type: grep -r advertisingIdentifier . (the dot at the end is critical)
This will recursively check every file, and give you the name of the offending library.
(in my case, it was Flurry)
Update
Google released Google Analytics Services iOS SDK v3.03c which removes the AdSupport.framework dependency by default.
Full changelog entry for Release Version 3.03c (February 19, 2014): https://developers.google.com/analytics/devguides/collection/ios/changelog
Old Awnser
My problem was with Google Analytics and TestFlight.
For TestFlight I just update the library to the version 2.2.1 (https://www.testflightapp.com/sdk/ios/release_notes/2.2.1/).
But for updating Google Analytics I had to remove the -ObjC flag. But as I use Cocoapods to manage some of third libraries, I couldn't just remove it. So I did the follow:
1 - started updating the libGoogleAnalytics.a to Version 3.03a (February 5, 2014)
2 - then a removed also the AdSupport.framework
3 - added "-force_load\ "${PROJECT_DIR}/Source/Library/GoogleAnalyticsServicesiOS_3.03a"" under "Target --> Build Settings --> Other Linker Flags"
(Note that in my project the GoogleAnalytics is inside /Source/Library/ folder, and you have to configure your own)
But as I coudn't remove -ObjC flag I searched for how to use -force_load flag with Cocoapods, then I found two useful links:
1 - https://github.com/CocoaPods/CocoaPods/issues/712
2 - http://www.deanmao.com/2012/12/31/linker-error-using-cocoapods/
To summarize I changed the -ObjC flag for "-force_load $(TARGET_BUILD_DIR)/libPods.a" also under "Target --> Build Settings --> Other Linker Flags"
But again, when I tried to publish my app I got an error telling me that the compiler didn't find libPods.a, so I went to "Target --> Build Settings --> Other Linker Flags --> Release" and change this string $(TARGET_BUILD_DIR) to ${BUILT_PRODUCTS_DIR}.
So my Other Linker Flags became like the image below.
Hope to help somebody.
Sorry for my english.
=]
For me, Flurry Analytics and TestFlight were both the problem.
For TestFlight, it's as easy as updating it. The 2.2.1 version won't cause any problem (I checked using strings, as Apple suggest)
For Flurry, there is currently no fix apart from removing Flurry, and contrary to Lou Weed suggestion, even if AdSupport.framework is not linked, your app will be rejected.
Here is Flurry support answer :
"Thank you for reaching out to Flurry. We have recently learned that Apple has rejected some apps it believes are using the Identifier for Advertising (IDFA) without including ad functionality. Please note that Flurry does not collect the IDFA unless an app includes the AdSupport.framework for ad functionality. We are seeking clarification with Apple and we will update our affected customers as we learn more over the next several days."
Flurry just released the version 4.3.2 of their SDK, which specifically address that problem.
Turns out the Testflight v2.2.0 was the conflict. They have since fixed it according to their changelog: Consolidate both SDK versions into one which removes all access to ASIdentifierManager
Crashlytics was the problem. We had a few apps rejected because of it. But I already talked with Crashlytics and they released a new update today (version 2.1.6) which fix this issue.
Several libraries have the AdSupport.framework but they do not use it unless specifically called. Crashlytics was calling the framework because it had to check if the app had support for ads. And that change was implemented on version 2.1.5
So if you are using crashlytics, that's the most probable reason. To fix that, just re-archive your app so crashlytics can use the new version with this fix.
Response from Crashlytics Team:
"We just pushed out an update for this- can you build and run your app again with the Mac app open so it can update your SDK? You'll be all good to go after that! Keep me posted after you resubmit :)"
PS: This is starting to happen because Apple seem to have changed their policy for ADSupport usage.
I'd previously written the following in comments, directing people to the "strings" or "otool" terminal commands. However, I really like the suggested answer of using grep. So you can try it first. My suggestion is to prepend "git" to that command, because it's so much faster:
git grep advertisingIdentifier
If that doesn't work, then try (as posted earlier):
grep -r advertisingIdentifier .
What follows is what I'd previously written in a comment above, as a how-to for terminal commands:
You can search your project's files in Xcode or you can try removing the AdSupport framework to see what fails at build/run time.
To use the terminal, click Spotlight (search) and type Terminal. Wait for it to appear as an Application in the search results.
Once in Terminal, type "cd" followed by a space, then drag and drop your Xcode build folder from Finder into Terminal. This should automatically type that folder name in. Hit Enter, and it will change directories (cd) you to that folder.
From there, type strings then a space, then the filename for your library or otool, a space and the filename for library. You should be able to hit TAB to auto-complete filenames.
My app was also rejected with the same error! I found an occurrence of advertisingIdentifier in the latest Facebook SDK (3.12). Maybe you can check your library's for an occurence with the method below:
I opened the FacebookSDK.framework as a library in the terminal and typed the following command
otool -v -s __TEXT __objc_methname FacebookSDK | grep advertisingIdentifier
But I don't know what to do. Was my app rejected because of this reference? If yes what to do if I want to use facebook functionalities in my app?
This is a bit more complicated than it seems on the surface. After some experimentation I found that the AdSupport Framework is linked even if only directly accessing classes that are referenced in the AdSupport Framework. Ironically, [AsIdentifierManager class], which is used in a lot of third-party libraries to check whether or not the AdSupport Framework has been linked, will actually cause the AdSupport Framework to be linked. Obfuscating the class by using NSClassFromString(#"AsIdentfierManager") will not cause the AdSupport framework to be automatically linked. Of course, most of the time this code will be in third-party libraries so you won't have much control over it, however, this is what's going on.
I built an example project on GitHub that illustrates this behavior using Segment.io's framework.
https://github.com/distefam/AdSupportDemo
Flurry Analytics uses this API as well.
Terminal output:
Binary file ./Lib/Flurry/libFlurry_4.3.0.a matches
Flurry says that the selector is not called if AdSupport framework isn't linked.
So I removed the framework and tried submitting again.

My app was just rejected for using the Ad support framework. Which library is responsible?

This was simply an update that didn't change anything to do with the rejection reason. Here is the response from the resolution center:
Reasons
Program License Agreement
PLA 3.3.12
We found your app uses the iOS Advertising Identifier but does not include ad functionality. This does not comply with the terms of the iOS Developer Program License Agreement, as required by the App Store Review Guidelines.
Specifically, section 3.3.12 of the iOS Developer Program License Agreement states:
"You and Your Applications (and any third party with whom you have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier."
Please check your code - including any third-party libraries - to remove any instances of:
class: ASIdentifierManager
selector: advertisingIdentifier
framework: AdSupport.framework
If you are planning to incorporate ads in a future version, please remove the Advertising Identifier from your app until you have included ad functionality.
To help locate the Advertising Identifier, use the “nm” tool. For information on the “nm” tool, open a terminal window and enter, “man nm.”
If you do not have access to the libraries source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool lists the methods that the library calls, and "otool -ov" will list the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.
The third party libraries I'm using is the latest version of parse.com sdk, latest version of flurry analytics, and version 2.2 of test flight. Does anybody know which library is the issue? Thanks
In Terminal:
Go to the root folder of your project
Type: grep -r advertisingIdentifier . (the dot at the end is critical)
This will recursively check every file, and give you the name of the offending library.
(in my case, it was Flurry)
Update
Google released Google Analytics Services iOS SDK v3.03c which removes the AdSupport.framework dependency by default.
Full changelog entry for Release Version 3.03c (February 19, 2014): https://developers.google.com/analytics/devguides/collection/ios/changelog
Old Awnser
My problem was with Google Analytics and TestFlight.
For TestFlight I just update the library to the version 2.2.1 (https://www.testflightapp.com/sdk/ios/release_notes/2.2.1/).
But for updating Google Analytics I had to remove the -ObjC flag. But as I use Cocoapods to manage some of third libraries, I couldn't just remove it. So I did the follow:
1 - started updating the libGoogleAnalytics.a to Version 3.03a (February 5, 2014)
2 - then a removed also the AdSupport.framework
3 - added "-force_load\ "${PROJECT_DIR}/Source/Library/GoogleAnalyticsServicesiOS_3.03a"" under "Target --> Build Settings --> Other Linker Flags"
(Note that in my project the GoogleAnalytics is inside /Source/Library/ folder, and you have to configure your own)
But as I coudn't remove -ObjC flag I searched for how to use -force_load flag with Cocoapods, then I found two useful links:
1 - https://github.com/CocoaPods/CocoaPods/issues/712
2 - http://www.deanmao.com/2012/12/31/linker-error-using-cocoapods/
To summarize I changed the -ObjC flag for "-force_load $(TARGET_BUILD_DIR)/libPods.a" also under "Target --> Build Settings --> Other Linker Flags"
But again, when I tried to publish my app I got an error telling me that the compiler didn't find libPods.a, so I went to "Target --> Build Settings --> Other Linker Flags --> Release" and change this string $(TARGET_BUILD_DIR) to ${BUILT_PRODUCTS_DIR}.
So my Other Linker Flags became like the image below.
Hope to help somebody.
Sorry for my english.
=]
For me, Flurry Analytics and TestFlight were both the problem.
For TestFlight, it's as easy as updating it. The 2.2.1 version won't cause any problem (I checked using strings, as Apple suggest)
For Flurry, there is currently no fix apart from removing Flurry, and contrary to Lou Weed suggestion, even if AdSupport.framework is not linked, your app will be rejected.
Here is Flurry support answer :
"Thank you for reaching out to Flurry. We have recently learned that Apple has rejected some apps it believes are using the Identifier for Advertising (IDFA) without including ad functionality. Please note that Flurry does not collect the IDFA unless an app includes the AdSupport.framework for ad functionality. We are seeking clarification with Apple and we will update our affected customers as we learn more over the next several days."
Flurry just released the version 4.3.2 of their SDK, which specifically address that problem.
Turns out the Testflight v2.2.0 was the conflict. They have since fixed it according to their changelog: Consolidate both SDK versions into one which removes all access to ASIdentifierManager
Crashlytics was the problem. We had a few apps rejected because of it. But I already talked with Crashlytics and they released a new update today (version 2.1.6) which fix this issue.
Several libraries have the AdSupport.framework but they do not use it unless specifically called. Crashlytics was calling the framework because it had to check if the app had support for ads. And that change was implemented on version 2.1.5
So if you are using crashlytics, that's the most probable reason. To fix that, just re-archive your app so crashlytics can use the new version with this fix.
Response from Crashlytics Team:
"We just pushed out an update for this- can you build and run your app again with the Mac app open so it can update your SDK? You'll be all good to go after that! Keep me posted after you resubmit :)"
PS: This is starting to happen because Apple seem to have changed their policy for ADSupport usage.
I'd previously written the following in comments, directing people to the "strings" or "otool" terminal commands. However, I really like the suggested answer of using grep. So you can try it first. My suggestion is to prepend "git" to that command, because it's so much faster:
git grep advertisingIdentifier
If that doesn't work, then try (as posted earlier):
grep -r advertisingIdentifier .
What follows is what I'd previously written in a comment above, as a how-to for terminal commands:
You can search your project's files in Xcode or you can try removing the AdSupport framework to see what fails at build/run time.
To use the terminal, click Spotlight (search) and type Terminal. Wait for it to appear as an Application in the search results.
Once in Terminal, type "cd" followed by a space, then drag and drop your Xcode build folder from Finder into Terminal. This should automatically type that folder name in. Hit Enter, and it will change directories (cd) you to that folder.
From there, type strings then a space, then the filename for your library or otool, a space and the filename for library. You should be able to hit TAB to auto-complete filenames.
My app was also rejected with the same error! I found an occurrence of advertisingIdentifier in the latest Facebook SDK (3.12). Maybe you can check your library's for an occurence with the method below:
I opened the FacebookSDK.framework as a library in the terminal and typed the following command
otool -v -s __TEXT __objc_methname FacebookSDK | grep advertisingIdentifier
But I don't know what to do. Was my app rejected because of this reference? If yes what to do if I want to use facebook functionalities in my app?
This is a bit more complicated than it seems on the surface. After some experimentation I found that the AdSupport Framework is linked even if only directly accessing classes that are referenced in the AdSupport Framework. Ironically, [AsIdentifierManager class], which is used in a lot of third-party libraries to check whether or not the AdSupport Framework has been linked, will actually cause the AdSupport Framework to be linked. Obfuscating the class by using NSClassFromString(#"AsIdentfierManager") will not cause the AdSupport framework to be automatically linked. Of course, most of the time this code will be in third-party libraries so you won't have much control over it, however, this is what's going on.
I built an example project on GitHub that illustrates this behavior using Segment.io's framework.
https://github.com/distefam/AdSupportDemo
Flurry Analytics uses this API as well.
Terminal output:
Binary file ./Lib/Flurry/libFlurry_4.3.0.a matches
Flurry says that the selector is not called if AdSupport framework isn't linked.
So I removed the framework and tried submitting again.

Resources