android - 无法解析 SerializedName

标签 android

我制作了一个 Bean 类,但是当我运行它时,这会出错。我不知道我该如何解决它。请帮我。

 Error:(7, 8) error: cannot find symbol class SerializedNameError:Execution failed for task ':app:compileDebugJavaWithJavac'.

这是 build.gradle:
 apply plugin: 'com.android.application'android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.example.administrator.Myappliction"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}}   dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.android.support:design:23.1.1'
compile files('libs/gson_1.7.jar')
compile files('libs/gson-2.2.4.jar')
compile "com.google.android.gms:play-services:8.3.0"}

最佳答案

只需添加 implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
在您的 Gradle 文件(应用程序)中

关于android - 无法解析 SerializedName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35767319/

相关文章:

java - 从 BroadcastReceiver 启动 Activity

java - bindView() 中的 ListView.setItemChecked() 带走了我刚刚单击的 EditText 的焦点

android - 如何在 Android map 上制作动画叠加图钉

android - 如何引用资源值中的 ?attr/actionBarSize?

android - 谷歌地图 Android API v2 : Is there a quick way to know if there is a Marker at a given location?

java - java中的嵌套方法?

android - 状态栏没有阴影

android - 更新卡片 View 列表中的文本?

android - 缺少 "build signed apk"的选项

安卓:测试套件