Firebase不会从pod或服务器上获取最新的google ad mob SDK

时间:2017-01-25 06:48:50

标签: ios objective-c firebase google-admob

由于我已阅读了许多 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更新谷歌需要定期更新这个库。

请自昨晚以来我一直在这里帮助我。

提前致谢。

2 个答案:

答案 0 :(得分:1)

自昨晚以来我一直在努力解决这个问题,最后我找到了解决方案,所以我发布了自己的答案,所以可能会得到一些帮助。

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

所以我在下面的步骤中制作了最新的Google移动广告SDK 7.16。

步骤1:按以下命令清除所有CocoaPod缓存。

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

步骤2:再次设置窗格以获取主POD的所有回购。

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。

谢谢!

答案 1 :(得分:1)

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

使用pod update后,Firebase已更新为新版本,其中包含最新版本的Google-Mobile-Ads-SDK。

CocoaPods not updating Firebase SDK to Version 4.0.0

的差异进行了很好的解释