shelf
shelf copied to clipboard
error after Code Obfuscating under release mode
Hi, I am using shelf_plus to respond a text. but if no obfuscating, it runs ok. after I obfuscating the code,
with flutter build apk --obfuscate --split-debug-info=/doubantv/debug-info will reports an error:
Error thrown by handler. NoSuchMethodError: Closure call with mismatched arguments: function 'Oxb' Receiver: Closure: (dva) => Future<CC> Tried calling: Oxb Found: Oxb(dva) => Future<CC>
because it's release mode. I don;t know how to debug the problem, but it seems the error caused here
@mraleph - can you suggest any way to get more information about the failure?
@hpp0hpp - do you have a stack trace? Does it point to anywhere helpful?
It would help to see the stack trace. The error just indicates a mismatched closure call of some sort. I would not be surprised that maybe something like Type.toString()
is used somewhere and things go south.
@mraleph - can you suggest any way to get more information about the failure?
@hpp0hpp - do you have a stack trace? Does it point to anywhere helpful?
It would help to see the stack trace. The error just indicates a mismatched closure call of some sort. I would not be surprised that maybe something like
Type.toString()
is used somewhere and things go south.
HI @natebosch @mraleph
Hi I would like to share more information, but the obfuscate only allow under release mode, I don't know how to produce a stack trace for that. this error is reported in logcat.
Do you get any stack trace printed?
You could just patch shelf code to do print('$stackTrace');
before _logError
.
After that you can deobfuscate it using the debug information you split out. See
https://docs.flutter.dev/deployment/obfuscate#reading-an-obfuscated-stack-trace