Closed philer-jambit closed 4 months ago
Make sure you are using the latest version of protobuf (3.1.0), and run dart pub get
. The named parameter is defined https://pub.dev/documentation/protobuf/latest/protobuf/BuilderInfo/m.html (search for valueDefaultOrMaker
) so you probably have a problem with your setup.
It turns out we are still on v2 (I was a bit confused about the distinct versions for the protobuf compiler and support library) due to a dependency. So now we are stuck here: https://github.com/PhilipsHue/flutter_reactive_ble/issues/785
Since that is outside of your domain I guess this issue can be closed. Thank you for your support! :)
In case anyone else gets stuck in the same place: As a workaround we're currently just removing the offending parameter.
find -name "*.pb.dart" | xargs sed -i 's/valueDefaultOrMaker: [[:alnum:]]\+\.getDefault,//g'
When I compile the following protobuf I get invalid dart code:
The generated code contains this block:
Full file: example.pb.dart.txt
The argument
valueDefaultOrMaker
is noted as an error by dart:The named parameter 'valueDefaultOrMaker' isn't defined.
This was previously reported in #786. At the time it was noted that the user was probably on a not yet released version – however the bug (presumably?) has since been released.
Please let me know if there is anything else I should try or do to help.
dart protoc_plugin installed via
dart pub global activate protoc_plugin
: 21.1.2 protoc downloaded from https://github.com/protocolbuffers/protobuf/releases/tag/v26.1