flutter_secure_storage
flutter_secure_storage copied to clipboard
[Mobile] Getting Flutter_secure_storage_windows Error
I got an error when i just using mobile for flutter_secure_storage_windows.
Here the error
/C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/lib/src/flutter_secure_storage_windows_ffi.dart:253:45:` Error: The argument type 'Pointer<Uint8>' can't be assigned to the parameter type 'int'.
- 'Pointer' is from 'dart:ffi'.
- 'Uint8' is from 'dart:ffi'. if (LocalFree(plainTextBlob.ref.pbData).address != NULL) { ^ /C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/lib/src/flutter_secure_storage_windows_ffi.dart:253:53: Error: The getter 'address' isn't defined for the class 'int'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'address'. if (LocalFree(plainTextBlob.ref.pbData).address != NULL) { ^^^^^^^ /C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/lib/src/flutter_secure_storage_windows_ffi.dart:371:47: Error: The argument type 'Pointer<Uint8>' can't be assigned to the parameter type 'int'.
- 'Pointer' is from 'dart:ffi'.
- 'Uint8' is from 'dart:ffi'. if (LocalFree(encryptedTextBlob.ref.pbData).address != NULL) { ^ /C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/lib/src/flutter_secure_storage_windows_ffi.dart:371:55: Error: The getter 'address' isn't defined for the class 'int'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'address'. if (LocalFree(encryptedTextBlob.ref.pbData).address != NULL) { ^^^^^^^ Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
Where: Script 'C:\Flutter\main\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1297
What went wrong: Execution failed for task ':app:compileFlutterBuildDevDebug'.
Process 'command 'C:\Flutter\main\bin\flutter.bat'' finished with non-zero exit value 1 `
I just using this for Mobile Version. And this i got when running the mobile version
@wibowoCodeId Please provide minimal reproducable code.
@wibowoCodeId Please provide minimal reproducable code.
Here the code i using this secure storage to secure the hive key.
Future<List<int>> hiveKeys() async {
const FlutterSecureStorage ss = FlutterSecureStorage();
const AndroidOptions aOptions = AndroidOptions(
encryptedSharedPreferences: true,
);
const IOSOptions iOptions = IOSOptions(
accessibility: KeychainAccessibility.first_unlock,
);
String? stringKey = await ss.read(
key: 'boxKey',
aOptions: aOptions,
iOptions: iOptions,
);
late List<int> hiveKey;
if (stringKey != null) {
hiveKey = stringKey.codeUnits;
} else {
hiveKey = Hive.generateSecureKey();
final Uint8List bytes = Uint8List.fromList(hiveKey);
stringKey = String.fromCharCodes(bytes);
await ss.write(
key: 'boxKey',
value: stringKey,
aOptions: aOptions,
iOptions: iOptions,
);
}
return hiveKey;
}
Same issue
some issue
Is there a solution to the problem?
just delete the folder "/C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0"
and it will work.
Is there a solution to the problem?
just delete the folder "/C:/Users/fauzi/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0"
and it will work.
if you put the dependencies_override : win32 , remove it , it is the solution
if you put the dependencies_override : win32 , remove it , it is the solution
in my case i have win32 under the dependencies_override, but i have just upgraded it to : win32: ^5.0.0, and it worked for me.
I am closing all older issues. If this issue still exists in the latest version, please let me know.