Xamarin
Xamarin.Android
Nuget
Google Play
Service
Xamarin.Android 遇到 Google Play 的 Service 相關 Nuget 套件更新問題解決...
2018/02/01 08:37:09
0
606
1. 前言
在 Xamarin.Android 的 App 開發中,應該免不了會用到 Google 的 Play Service 相關的 Nuget 套件,像是 Google Map 或是 Firebase Notification 之類的服務,但是最近 Xamarin Android 的 Google Play 相關 Nuget 套件卻發生了靈異現象,讓我們來看看該如何解決吧!
2. 本文
2.1 升級 Google Play Service 的新版 Nuget 套件
- 打開專案的 Nuget 套件管理員,看到有不少 Nuget 套件要更新,在這邊先只勾選 Google Play 的 Service 相關 Nuget 套件更新。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231348.png)
- 開始更新確認。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231356.png)
- 接受授權
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231405.png)
- 靈異現象出現。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231412.png)
2.2 解決方式
- 在 Visual Studio 的選單中找到 "工具" -> "選項"。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231418.png)
- 在選項視窗當中的左邊列表,找到 Nuget 封裝管理員。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231424.png)
- 在右邊畫面點選 "清除所有 Nuget 快取"。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231429.png)
- 如果看到如下圖的清除失敗結果,請先關閉所有 Visual Studio 的視窗,再重新開啟 Visual Studio (但不要開專案) ,再重新作上述的動作一次。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231435.png)
- 清除成功。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231441.png)
- 再重新開啟 Xamarin.Android 的專案,更新 Google Play 的 Service 相關 Nuget 套件。
![](https://www.tpisoftware.com/tpu/File/employee/edit/html/201801/20180131151005/images/20180131231448.png)
3. 結語
此靈異現象發生 Google Play 的 Service 相關 Nuget 套件在 42.xxxx.x 版本要升級到 60.xxxx.x 版本的時候,如果有遇到這樣的問題按照上述方法就能解決,分享給大家。