Cocoapods iOS - [!] Google has been deprecated - How to get rid of the warning?

依然范特西╮ 提交于 2019-12-08 14:25:56

问题


Steps I did:

  1. pod repo remove master

  2. pod setup

  3. pod update --verbose (Just to check the progress especially when updating the Google SDKs, took so long to finish).

And there, I got the warning. In my logs, Google SDKs were updated successfully:

-> Installing Google 3.1.0 (was 3.0.3)

-> Installing GoogleMaps 2.3.0 (was 2.2.0)

Podfile:

target 'MyProj' do

    ...
    pod 'Google/Analytics'
    pod 'GoogleMaps'
    ...
    target 'MyProjTests' do
        inherit! :search_paths
    end

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
end

I would like to know how to get rid of this warning.


回答1:


Change pod 'Google/Analytics' to pod 'GoogleAnalytics' removing the slash.




回答2:


Extending on Paul Beusterien answer:

First, remove old import from your bridging header:

#import <Google/Analytics.h>

Then, add the following to the bridging header instead:

#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"

Finally you might want to recheck: https://developers.google.com/analytics/devguides/collection/ios/v3/

You don't need GGLContext line anymore.

Hope this helps.



来源:https://stackoverflow.com/questions/44538472/cocoapods-ios-google-has-been-deprecated-how-to-get-rid-of-the-warning

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!