Closed peterweb2005 closed 2 years ago
Unfortunately, this tells me nothing. Can you provide a localized reproducible code snippet to illustrate the issue?
need much much times, but
is that related to this:
@jsonSerializable
@Json(
ignoreNullMembers: true,
valueDecorators: Test.valueDecorators,
)
class Test {
//
List<List<String>>? timetable;
static Map<Type, ValueDecoratorFunction> valueDecorators() => {
typeOf<List<List<String>>>(): (value) => value.cast<List<String>>(),
typeOf<List<String>>(): (value) => value.cast<String>()
};
}
screen capture stacktrace https://ibb.co/S0vQVCT
quite sure the problem related to valueDecorators,
i just commented the field & related stuffs, generate files, build apk, install, run the alert has not been displayed
Hello,
First of all, thank you for your work !
I'm facing exactly the same issue with my release build for both iOS and Android (working fine in debug / profile mode). Last working build was build Sept 30.
When I call JsonMapper.serialize(mySuperClass)
I got this exception : It seems your class _GrowableList< anotherClass > has not been annotated with @JsonSerializable.
I tried to downgrade dart_json_mapper: ^2.1.16
to ^2.1.2, dart_json_mapper_flutter: ^2.0.1
to ^2.0.0 and build_runner: ^2.1.4
to ^2.1.1 and regenerated mapper.g.dart file (my previous working build config) but the issue is still here.
I also tried to downgrade Flutter v2.5.3
to v2.5.2 and tried to build with --no-shrink
flag but same result.
How can I help you to investigate ?
Thank you both for reporting that 🤗 I hope I'll have enough time to nail it down. Not promising it'll be blazingly fast, but it will be fixed anyway.
Update:
I forgot to remove the '^' when I downgraded dart_json_mapper to 2.1.2 and and dart_json_mapper_flutter to 2.0.0. I did it in the right way and it's working again.
I'll try each version tonight to figure out which one introduces the issue.
Ok so... I can't upgrade package above v2.1.2 otherwise my app release build will trigger the exception, which sounds really strange to me.
Maybe I missed something with my config ?
MainClass:
@jsonSerializable
@Json(valueDecorators: MainClass.valueDecorators)
class MainClass {
static Map<Type, ValueDecoratorFunction> valueDecorators() => {
typeOf<List<OtherClassA>>(): (value) => value.cast<OtherClassA>(),
typeOf<Map<String, List<OtherClassB>>>(): (value) =>
value.cast<String, List<OtherClassB>>(),
typeOf<List<OtherClassB>>(): (value) => value.cast<OtherClassB>()
};
List<OtherClassA> listOfClassA = [];
Map<String, List<OtherClassB>> mapOfListsOfClassB =
<String, List<OtherClassB>>{};
Future<void> fillfromJson(Map<String, dynamic> json) async {
...
}
}
OtherClassA:
@jsonSerializable
class OtherClassA {
String name = '';
int number = 0;
void fillFromJson(Map<String, dynamic> json) {
...
}
}
OtherClassB:
@jsonSerializable
class OtherClassB {
[endless list of properties]
[some methods]
}
it is same error on my release build with flutter 2.5.3
the error begin when flutter update 2.5.x from 2.2.x
as title development time is good
thanks