久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何將 Gson 附加功能添加到 Android 項(xiàng)目?

How to add Gson extras to an Android project?(如何將 Gson 附加功能添加到 Android 項(xiàng)目?)
本文介紹了如何將 Gson 附加功能添加到 Android 項(xiàng)目?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在使用 gson 解析器(最新版本 -> 2.8.2).

I am using gson parser (latest version -> 2.8.2).

我想使用 RuntimeTypeAdapterFactory 這是 gson extras 的一部分.

I would like to use RuntimeTypeAdapterFactory which is part of the gson extras.

在我的 build.gradle 中,目前只有一個(gè)編譯指令:

In my build.gradle there is currently a single compile directive:

compile 'com.google.code.gson:gson:2.8.2'

然而,這給了我只有 gson 庫(kù)沒(méi)有額外的(RuntimeTypeAdapterFactory 在項(xiàng)目中無(wú)法識(shí)別......).

However this gives me only the gson lib without the extras (RuntimeTypeAdapterFactory is not recognized in the project...).

我查看了 gson extras 的 pom 文件(https://github.com/google/gson/blob/master/extras/pom.xml)和嘗試將以下行添加到我的構(gòu)建 gradle:

I have looked at gson extras' pom file (https://github.com/google/gson/blob/master/extras/pom.xml) and tried to add below line to my build gradle:

compile 'com.google.code.gson:gson-extras:2.8.2'

但 gradle 只是不會(huì)編譯 gson 附加功能:

But gradle just won't compile the gson extras:

"Error:Failed to resolve: com.google.code.gson:gson-extras:2.8.2"

任何想法如何使這項(xiàng)工作?

Any Idea how to make this work?

非常感謝您在此問(wèn)題上的時(shí)間和幫助.

Thank you very much for your time and assistance in this matter.

推薦答案

錯(cuò)誤:無(wú)法解決:com.google.code.gson:gson-extras:2.8.2

Error:Failed to resolve: com.google.code.gson:gson-extras:2.8.2

額外的包未在 Maven 中發(fā)布.

您可以檢查這些問(wèn)題:

  • https://github.com/google/gson/issues/1104
  • https://github.com/google/gson/issues/1123

如您所見(jiàn),此包尚未發(fā)布,使用其中的類的最佳方法是在您的項(xiàng)目中包含源代碼.

As you can read this package is not published and the best way to use the classes inside is just to include source-code in your project.

這篇關(guān)于如何將 Gson 附加功能添加到 Android 項(xiàng)目?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當(dāng)前風(fēng)味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復(fù)“意外元素lt;查詢gt;在“清單中找到錯(cuò)誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風(fēng)味庫(kù)的多風(fēng)味應(yīng)用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運(yùn)行時(shí)有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫(kù)的傳遞依賴)
主站蜘蛛池模板: 国产精品欧美激情 | 国产一区二区三区 | 可以免费看黄的网站 | 玖玖久久 | 成人午夜在线 | 国产精品视频久久久 | 毛片一区| 91国在线 | 亚洲成人av在线 | 三级在线播放 | 福利视频网址 | 国产视频一| 18色av| 天天舔天天干 | 国产精品日韩在线 | 国产免费一级 | 日韩精品视频在线 | 91精品久久久久 | 国产又粗又猛 | 午夜激情网站 | www.久久久久 | 性网址| 神马午夜我不卡 | 国产三级在线观看 | 亚洲精品乱码久久久久久蜜桃91 | 2014天堂网 | 黄视频网站在线观看 | 96久久| 成人午夜免费视频 | 欧美xx孕妇 | 欧美区在线 | 国产精品国产三级国产 | 中文毛片 | 91最新网站| 精品伊人久久 | 日韩精品三级 | 午夜激情在线观看 | 色婷婷国产 | 久热在线 | 3d动漫精品h区xxxxx区 | 伊人久久精品视频 |