daegalus / dart-otp

RFC6238 Time-Based One-Time Password / Google Authenticator Library
MIT License
100 stars 25 forks source link

"Int64 accessor not supported by dart2js." exception after upgrading to 2.1.0 for flutter web #18

Closed zTrix closed 4 years ago

zTrix commented 4 years ago

Thanks first for making such great and clean OTP library, I've used this lib for a long time working pretty well, until recently, after upgrading to 2.1.0, exception occur when calling generateTOTPCodeString(secret, timeSinceEpochInMilliseconds, algorithm: Algorithm.SHA1)

Int64 accessor not supported by dart2js.

My environment config as below:

$ flutter --version
Flutter 1.17.0-3.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 0da1ab0922 (4 days ago) • 2020-04-28 11:02:34 -0700
Engine • revision 376ad6a64b
Tools • Dart 2.8.0

Downgrading to 2.0.3 solved this issue.

So I guess this issue may be introduced by commit like https://github.com/Daegalus/dart-otp/commit/915b04f7b1f71991916f6f7ca1b53bb280178da4

daegalus commented 4 years ago

Thanks for the report. I'll look into this soon. Sorry for the inconvenience

daegalus commented 4 years ago

Found the problem. In my attempt to make my int2bytes function more efficient/cleaner, I used a method that involved int64 functions that dont exist in Dart2js

I reverted the function and will be releasing it with 2.2 shortly.

daegalus commented 4 years ago

Ok, 2.2.0 is out, please tell me if that fixes it for you.

zTrix commented 4 years ago

Just tested 2.2.0 and everything works now! Thanks very much!