我正在开发一个简单的应用程序,在身份验证方面,我需要使用加密包来加密jwt令牌,但是由于我安装了加密依赖关系,flutter现在给我这个错误:
flutter pub add encrypt Launching lib\main.dart on Chrome in debug mode...
flutter/.pub-cache/hosted/pub.dartlang.org/pointycastle-3.1.3/lib/key_derivators/argon2.dart:42:27:
Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
Try changing the literal to something that can be represented in Javascript.
In Javascript 0x10000000000000000 is the nearest value that can be represented exactly. static const int M32L = 0xFFFFFFFFFFFFFFFF;
flutter/.pub-cache/hosted/pub.dartlang.org/pointycastle-3.1.3/lib/src/utils.dart:313:9:
Error: The integer literal 0xFFFFFFFFFFFFFFFF can't be represented exactly in JavaScript.
Try changing the literal to something that can be represented in Javascript.
In Javascript 0x10000000000000000 is the nearest value that can be represented exactly. ((0xFFFFFFFFFFFFFFFF) ^ ((1 << (64 - count)) - 1));
flutter/.pub-cache/hosted/pub.dartlang.org/pointycastle-3.1.3/lib/src/platform_check/platform_check.dart:6:35: Error: Method not found: 'getPlatform'. static Platform get instance => getPlatform(); Failed to compile application.或者,您是否知道其他可以对字符串进行加密的库?
发布于 2021-07-12 13:35:31
pointycastle-3.1.3并不完全支持web。
如果是您在pubspec.yaml中添加的依赖包,请将其升级到预发布版本;
dependencies:
pointycastle: ^3.2.0-rc0但如果它依赖于您导入的另一个包,则添加预发布版本作为依赖覆盖;
dependency_overrides:
pointycastle: ^3.2.0-rc0发布于 2021-07-15 01:51:19
我没有足够的名气来评论之前的答案,但有一些事情需要纠正:
dependency_overrides:而不是
dependency_override:https://stackoverflow.com/questions/68258403
复制相似问题