【问题标题】:Firebase admob not taking latest google ad mob SDK from pod or serverFirebase admob 未从 pod 或服务器获取最新的 google ad mob SDK
【发布时间】:2017-01-25 06:48:50
【问题描述】:

当我阅读了许多与 Firebase AdMob 相关的问题及其解决方案时,我对我的应用程序和CocoaPod 更新做了同样的事情,但仍然面临库问题并收到以下错误:

[GADMobileAds configureWithApplicationID:@"ca-app-pub-3940256099942544~1458002511"];

错误:所选方法没有未知类 configureWithApplicationID

问题参考:Can't Update Google AdMob in iOS Project

不过,它仍然低于 POD 的 SDK 版本

Google-Mobile-Ads-SDK (7.8.1)

虽然我手动强制更新最新版本,如下所示:

pod 'Google-Mobile-Ads-SDK', '~> 7.16'

还有

pod 'Google-Mobile-Ads-SDK', '~> 7.9.1'

参考:基于 CocoaPod 网站

target 'MyApp' do pod 'Google-Mobile-Ads-SDK', '~> 7.16' end

它会给我这样的错误:

[!] Unable to satisfy the following requirements:

- `Google-Mobile-Ads-SDK (= 7.16)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Google-Mobile-Ads-SDK (= 7.16)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

我也做了pod repo update

但仍然没有最新库的结果。

编辑:

虽然我手动下载它仍然给我旧库没有实现上述方法如何令人作呕的 SDK 更新谷歌需要定期更新这个库。

请帮帮我,就像我从昨晚开始就卡在这里一样。

提前致谢。

【问题讨论】:

    标签: ios objective-c firebase admob


    【解决方案1】:

    从昨晚开始,我一直在努力解决这个问题,最后,我找到了解决方案。虽然回答我自己的问题是为了帮助有同样问题的其他人。

    由于CocoaPod 也缓存到我们的系统中,这就是为什么它会产生问题并且无法从CocoaPod 服务器获取最新库。

    所以我做了以下步骤来实现最新的谷歌移动广告SDK 7.16。

    Step1:通过以下命令清除所有 CocoaPod 缓存。

    rm -rf "${HOME}/Library/Caches/CocoaPods"
    rm -rf "`pwd`/Pods/" 
    

    第 2 步:再次设置 pod 以从主 POD 获取所有 repo。

    pod setup
    

    第 3 步:从 POD 获取更新的库。

    pod update
    

    终于从 POD 获得了以下最新库:

    Analyzing dependencies
    Pre-downloading: `youtube-ios-player-helper` from `https://github.com/youtube/youtube-ios-player-helper`, commit `head`
    Removing GoogleUtilities
    Downloading dependencies
    Using AFNetworking (3.1.0)
    Installing Firebase 3.11.1 (was 3.2.0)
    Installing FirebaseAnalytics 3.6.0 (was 3.2.0)
    Installing FirebaseCore (3.4.7)
    Installing FirebaseInstanceID 1.0.8 (was 1.0.6)
    Installing Google-Mobile-Ads-SDK 7.16.0 (was 7.8.1)
    Installing GoogleInterchangeUtilities 1.2.2 (was 1.2.1)
    Installing GoogleSymbolUtilities 1.1.2 (was 1.1.1)
    Installing GoogleToolboxForMac (2.1.1)
    Installing MBProgressHUD 1.0.0 (was 0.9.2)
    Installing SDWebImage 3.8.2 (was 3.7.6)
    Installing youtube-ios-player-helper 0.1.6 (was 0.1.6)
    Generating Pods project
    Integrating client project
    

    所以现在我在我的应用中获得了最新版本的 SDK:

    **Installing Google-Mobile-Ads-SDK 7.16.0 (was 7.8.1)**
    

    希望这将有助于解决 CocoaPod 无法从服务器获取最新库或 SDK 的问题。

    谢谢!

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题。就我而言,这是因为我使用的是pod install 而不是pod update

      在我改用 pod update 后,Firebase 更新到了新版本,其中包括最新版本的 Google-Mobile-Ads-SDK。

      CocoaPods not updating Firebase SDK to Version 4.0.0 对差异的很好解释

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-10
        • 1970-01-01
        • 2016-04-10
        • 1970-01-01
        • 2016-09-20
        • 2016-03-28
        相关资源
        最近更新 更多