在帶有 Android 的 Xamarin Studio 上使用 AdMob,Google Play 服務不存在 (Use AdMob on Xamarin Studio with Android, Google Play Services don't exist)


問題描述

在帶有 Android 的 Xamarin Studio 上使用 AdMob,Google Play 服務不存在 (Use AdMob on Xamarin Studio with Android, Google Play Services don't exist)

我最近嘗試在我的 Xamarin Android 應用程序上使用 Google AdMob。但是,我一直未能成功。首先,我無法遵循教程,(例如,這個:https://blog.tommyparnell.com/admob‑with‑xamarin‑part‑1‑banner‑ads/),這裡是說去“獲取更多組件”(我我正在使用 Xamarin Studio)並下載 Google Play 服務(Jellybean)。但是,我找不到它,而是找到了很多 Google Play 服務組件。我試圖安裝一個名為:“Google Play Services ‑ Ads”(我想這個是與 Admobs 相關的)。但是,似乎有些東西不起作用,

Some required packages are not referenced by the project

我很絕望,真的不知道該怎麼做。我能做些什麼?另請注意,我擁有最新版本的 SDK。可能是這個問題嗎?如果是這樣,我該如何解決這個問題?

提前致謝


參考解法

方法 1:

That tutorial that you referred to is out‑dated and is using the deprecated version of the "Xamarin Google Play Services ‑ All" package.

You want the individual "Ads" package that will provide the ADMob namespace (using ADMob;) that will also install the related Play Service dependencies and you have to update the code accordingly from the tutorial to match the new Ads namespace/api. The overall code and process presented for showing ads is valid.

Open the Package Manager and search for "Xamarin Google Play Services Ads"

>Install‑Package Xamarin.GooglePlayServices.Ads ‑Version 27.0.0

enter image description here

Nuget Page:

https://www.nuget.org/packages/Xamarin.GooglePlayServices.Ads/27.0.0

Latest Beta Version:

https://www.nuget.org/packages/Xamarin.GooglePlayServices.Ads/28.0.0‑beta1

The 'Xamarin Google Play Services ‑ All' nuget package is now deprecated.

You should instead use the individual NuGet packages to get only the bindings you need in your application.

You can find the individual packages by searching for 'xamarin google play services': https://www.nuget.org/packages?q=xamarin+google+play+services

(by cilindr0SushiHangover)

參考文件

  1. Use AdMob on Xamarin Studio with Android, Google Play Services don't exist (CC BY‑SA 2.5/3.0/4.0)

#google-play-services #xamarin-studio #Android #admob #xamarin






相關問題

無法從 Android SDK 管理器安裝/下載 SDK (Unable to install/download SDK from Android SDK manager)

google-play-services_lib.jar bị thiếu trong thư mục lib SDK google_play_services (google-play-services_lib.jar missing from SDK google_play_services lib folder)

谷歌播放服務認證(oauth 2.0) (Google play service authentication (oauth 2.0))

在帶有 Android 的 Xamarin Studio 上使用 AdMob,Google Play 服務不存在 (Use AdMob on Xamarin Studio with Android, Google Play Services don't exist)

谷歌登錄使用新的 GoogleSignInOptions 獲取訪問令牌 (Google login get access token with new GoogleSignInOptions)

在組織內分發 Android 應用 (Distribute Android apps within organization)

如何提供啟用 GPS 的選項 (How to give option for enable GPS)

玩遊戲服務,我們能知道我們什麼時候通過另一個hiscore嗎? (Play Game Services, can we know when we pass another hiscore?)

Android 使用 Google 的位置服務對話框 (Android Use Google's location service dialog)

statusCode=SIGN_IN_REQUIRED, resolution=null 只有開發者 ID 可以登錄 else 錯誤 (statusCode=SIGN_IN_REQUIRED, resolution=null Only developer Id can Login else error)

項目中同時擁有 GMS 和 HMS (Have both GMS and HMS in the project)

谷歌cast MediaNotificationService 中的大量RemoteServiceExceptions (Large number of RemoteServiceExceptions in Google's cast MediaNotificationService)







留言討論