我制作了一个 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/