Description
We have a Flutter desktop application that implements Amplify Auth and S3 Storage. We distribute the application via MSIX installer. There has been no issues distributing and running the application until last week on one computer. The computer would not load the Authenticator widget as amplify would not configure correctly. Unable to recreate the issue on different computers, we installed the development tools on the problem computer and were given the following error:
"WorkerBeeExceptionImpl {
error=FormatException: Unexpected character (at character 3461)
...5,116,169,84,200,68,37,67,93,93,73]}00,248,76,52,251,89,255,138,43,0,216...
^
,
stackTrace=#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:913:48)
#2 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#3 JsonDecoder.convert (dart:convert/json.dart:610:36)
#4 JsonCodec.decode (dart:convert/json.dart:216:41)
#5 FileKeyValueStore.readAll
file_key_value_store.dart:96
#6 FileKeyValueStore.readKey
file_key_value_store.dart:70
#7 AmplifySecureStorageWindows.read
amplify_secure_storage_windows.dart:45
#8 SecureStorageWorker.run
secure_storage_worker.dart:53
#9 _run
secure_storage_worker.worker.vm.dart:14
,
}"
We tried pulling the amplify environment, reconfiguring the environment, and even deploying a test amplify environment. All attempts ran into the same issue. Below is a code snippet of what is being run and where it fails:
Fails on line: await Amplify.configure(amplifyconfig);
void main() async {
Paint.enableDithering = true;
WidgetsFlutterBinding.ensureInitialized();
await ColorThemes.themeInitialize();
await _configureAmplify();
await windowManager.ensureInitialized();
WindowOptions windowOptions = const WindowOptions(
size: Size(1200, 800),
center: true,
alwaysOnTop: false,
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.normal,
windowButtonVisibility: true,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.maximize();
await windowManager.show();
//await windowManager.focus();
});
runApp(const MyApp());
}
Future _configureAmplify() async {
try {
final auth = AmplifyAuthCognito();
final storage = AmplifyStorageS3();
await Amplify.addPlugins([auth, storage]);
await Amplify.configure(amplifyconfig);
final session = await Amplify.Auth.fetchAuthSession();
if (session.isSignedIn) {
await Amplify.Auth.signOut();
}
safePrint('Successfully configured');
} on Exception catch (e) {
safePrint('Error configuring Amplify: $e');
}
}
Any help would be greatly appreciated. Below is the flutter doctor from the computer with the issue:
flutter doctor -v
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.19045.3693], locale en-US)
• Flutter version 3.13.9 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (4 weeks ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\khines\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34221.43
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2022.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[√] VS Code (version 1.84.2)
• VS Code at C:\Users\khines\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.76.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3693]
• Chrome (web) • chrome • web-javascript • Google Chrome 119.0.6045.160
• Edge (web) • edge • web-javascript • Microsoft Edge 119.0.2151.72
[√] Network resources
• All expected network resources are available.
• No issues found!
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Flutter Version
3.13.9
Amplify Flutter Version
1.6.0
Deployment Method
Amplify CLI
Schema
No response
Description
We have a Flutter desktop application that implements Amplify Auth and S3 Storage. We distribute the application via MSIX installer. There has been no issues distributing and running the application until last week on one computer. The computer would not load the Authenticator widget as amplify would not configure correctly. Unable to recreate the issue on different computers, we installed the development tools on the problem computer and were given the following error:
We tried pulling the amplify environment, reconfiguring the environment, and even deploying a test amplify environment. All attempts ran into the same issue. Below is a code snippet of what is being run and where it fails:
Any help would be greatly appreciated. Below is the flutter doctor from the computer with the issue:
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Flutter Version
3.13.9
Amplify Flutter Version
1.6.0
Deployment Method
Amplify CLI
Schema
No response