-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error trying to "sign" (using the example snippet) #27
Comments
Which snippet are you referring to? |
I tried the snippet in the main README of the "kms" project (2. "use") here:
In the call to the
The desired "ed25519" implementation is the first element of the list, but singleWhere scans all the items in the list (not stopping at first match) so when you access the "name" property of the null item, you have the error. Perhaps just a c?.name would prevent the singleWhere from causing the error but, in my opinion, having a null in the list is still not good.What do you think? Is there something I'm missing or doing wrong , to prevent the defaultSignatureImplementations from containing a null ?
|
I have the same issue. Has there been any workaround to this? |
The kms package is deprecated for now. |
I just copy pasted the example and I got the error when trying to call "sign":
Unhandled Exception: NoSuchMethodError: The getter 'name' was called on null.
Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
_PluginKeyDocument.sign. (package:kms_flutter/src/plugin_kms.dart:205:31)
Iterable.singleWhere (dart:core/iterable.dart:618:15)
_PluginKeyDocument.sign (package:kms_flutter/src/plugin_kms.dart:205:10)
From my understanding in "defaultSignatureImplementations" there's a null. I tried to print the content and there's an instance of
'_Ed25519' and a 'null'. You can see this even in the sources that it's a map with two value. The last is null. So the sign method just throw exception while accessing the null.
Sure, at "plugin_kms.dart:205" the "singleWhere" should just find the algorithm Ed25519 and stop before analysing the null ... I don't know why (and this is another issue) but still having that null in "defaultSignatureImplementations" is bad (or at least it should be managed).
Any idea? Why is it not working?
(tried on emulator and real Android device with Oreo)
The text was updated successfully, but these errors were encountered: