हमें में सैमसंग डिवाइस मिल रहा है जब उपयोगकर्ता Play Store से ऐप अपडेट करता है। कृपया नीचे लॉग जांचें।असंगत क्लासChangeError com.google.gson.annotations.SerializedName.value
java.lang.IncompatibleClassChangeError: Couldn't find com.google.gson.annotations.SerializedName.value
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:659)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
at java.lang.reflect.Field.getAnnotation(Field.java:242)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldName(ReflectiveTypeAdapterFactory.java:71)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldName(ReflectiveTypeAdapterFactory.java:67)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:142)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:83)
at com.google.gson.Gson.getAdapter(Gson.java:359)
at com.google.gson.Gson.fromJson(Gson.java:809)
at com.google.gson.Gson.fromJson(Gson.java:775)
at com.google.gson.Gson.fromJson(Gson.java:724)
at com.google.gson.Gson.fromJson(Gson.java:696)
at com.cubii.utils.SessionManager.getUserID(SessionManager.java:70)
at com.cubii.BluetoothLeService.broadcastUpdate(BluetoothLeService.java:188)
at com.cubii.BluetoothLeService.access$400(BluetoothLeService.java:47)
at com.cubii.BluetoothLeService$1.onCharacteristicChanged(BluetoothLeService.java:139)
at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:443)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399)`enter code here`
at android.os.Binder.execTransact(Binder.java:446)
और कोड के रूप में नीचे है:
public int getUserID(){
try {
String json = preferences.getString("User", "");
LoginResponse loginResponse = new Gson().fromJson(json, LoginResponse.class);//getting error from this line
Integer id = 0;
if (loginResponse != null) {
if (loginResponse.getId() != null) {
id = loginResponse.getId();
} else {
id = loginResponse.getUserId();
}
}
return (id == null) ? 0 : id;
}catch (Exception e){
Logger.dump(e);
}
return 0;
}
LoginResponse मेरी POJO वर्ग है।
preferences.getString("User", "")
जेएसओएन स्ट्रिंग जो सर्वर प्रतिक्रिया है, लौटाएगा।
धन्यवाद @ सुनीलसुनी –
@ संजयकाडियाया आपका स्वागत है .. आशा है कि यह जल्द ही तय हो जाएगा .. –
मुझे अभी भी इस मुद्दे का सामना करना पड़ रहा है। कोई संकल्प? – Tasneem