Comments (6)
Hi @jonsamwell
Could you post full log ?
from flutter_secure_storage.
from flutter_secure_storage.
Do you have stacktrace for the exception?
Also could you check android code in your project? Does it contain implementation of readAll method?
It looks like there are different versions of plugin dart code and native code in your project. Somehow android project was built with 3.0 version, but dart code uses 3.1
from flutter_secure_storage.
I confirm this error when running on release mode. Here's the stacktrace:
Registration failed
java.security.InvalidKeyException: Failed to unwrap key
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:682)
at javax.crypto.Cipher.unwrap(Cipher.java:2435)
at com.it_nomads.fluttersecurestorage.ciphers.RSACipher18Implementation.unwrap(RSACipher18Implementation.java:46)
at com.it_nomads.fluttersecurestorage.ciphers.StorageCipher18Implementation.<init>(StorageCipher18Implementation.java:48)
at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.<init>(FlutterSecureStoragePlugin.java:46)
at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.registerWith(FlutterSecureStoragePlugin.java:33)
at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:39)
at vn.com.bibomart.app.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:6720)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2673)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2781)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
I tested on Android 7.1.1
from flutter_secure_storage.
I have same issues with android 8.0 and flutter 0.7.3
here is my log
E/FlutterSecureStoragePl( 9203): Registration failed
E/FlutterSecureStoragePl( 9203): java.security.InvalidKeyException: Failed to unwrap key
E/FlutterSecureStoragePl( 9203): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:682)
E/FlutterSecureStoragePl( 9203): at javax.crypto.Cipher.unwrap(Cipher.java:2126)
E/FlutterSecureStoragePl( 9203): at com.it_nomads.fluttersecurestorage.ciphers.RSACipher18Implementation.unwrap(RSACipher18Implementation.java:46)
E/FlutterSecureStoragePl( 9203): at com.it_nomads.fluttersecurestorage.ciphers.StorageCipher18Implementation.<init>(StorageCipher18Implementation.java:48)
E/FlutterSecureStoragePl( 9203): at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.<init>(FlutterSecureStoragePlugin.java:46)
E/FlutterSecureStoragePl( 9203): at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.registerWith(FlutterSecureStoragePlugin.java:33)
E/FlutterSecureStoragePl( 9203): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:25)
E/FlutterSecureStoragePl( 9203): at com.example.thuyloicuchi.MainActivity.onCreate(MainActivity.java:12)
E/FlutterSecureStoragePl( 9203): at android.app.Activity.performCreate(Activity.java:7009)
E/FlutterSecureStoragePl( 9203): at android.app.Activity.performCreate(Activity.java:7000)
E/FlutterSecureStoragePl( 9203): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
E/FlutterSecureStoragePl( 9203): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
E/FlutterSecureStoragePl( 9203): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
E/FlutterSecureStoragePl( 9203): at android.app.ActivityThread.-wrap11(Unknown Source:0)
E/FlutterSecureStoragePl( 9203): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
E/FlutterSecureStoragePl( 9203): at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterSecureStoragePl( 9203): at android.os.Looper.loop(Looper.java:164)
E/FlutterSecureStoragePl( 9203): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/FlutterSecureStoragePl( 9203): at java.lang.reflect.Method.invoke(Native Method)
E/FlutterSecureStoragePl( 9203): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
E/FlutterSecureStoragePl( 9203): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/FlutterSecureStoragePl( 9203): Caused by: javax.crypto.IllegalBlockSizeException
E/FlutterSecureStoragePl( 9203): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:519)
E/FlutterSecureStoragePl( 9203): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:680)
E/FlutterSecureStoragePl( 9203): ... 20 more
E/FlutterSecureStoragePl( 9203): Caused by: android.security.KeyStoreException: Unknown error
E/FlutterSecureStoragePl( 9203): at android.security.KeyStore.getKeyStoreException(KeyStore.java:697)
E/FlutterSecureStoragePl( 9203): at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
E/FlutterSecureStoragePl( 9203): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
E/FlutterSecureStoragePl( 9203): ... 21 more
E/flutter ( 9203): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 9203): MissingPluginException(No implementation found for method read on channel plugins.it_nomads.com/flutter_secure_storage)
E/flutter ( 9203): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #1 FlutterSecureStorage.read (package:flutter_secure_storage/flutter_secure_storage.dart:16:24)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #2 SecureStorageService.read (package:thuyloi_cuchi/services/secure_storage.service.dart:16:27)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #3 AuthService.checkAuthenticated (package:thuyloi_cuchi/services/auth.service.dart:21:54)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #4 checkLogin (file:///D:/Projects/ThuyLoiCuChi/gs-thuyloi-cuchi-mobile/thuyloi_cuchi/lib/main.dart:54:21)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #5 main (file:///D:/Projects/ThuyLoiCuChi/gs-thuyloi-cuchi-mobile/thuyloi_cuchi/lib/main.dart:58:9)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #6 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:289:19)
E/flutter ( 9203): #7 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
Syncing files to device Redmi Note 4... 11.4s
🔥 To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on Redmi Note 4 is available at: http://127.0.0.1:63780/
For a more detailed help message, press "h". To quit, press "q".
Performing hot restart...
Restarted application in 3,707ms.
I/zygote64( 9203): Do partial code cache collection, code=30KB, data=23KB
I/zygote64( 9203): After code cache collection, code=30KB, data=23KB
I/zygote64( 9203): Increasing code cache capacity to 128KB
E/flutter ( 9203): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 9203): MissingPluginException(No implementation found for method write on channel plugins.it_nomads.com/flutter_secure_storage)E/flutter ( 9203): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #1 FlutterSecureStorage.write (package:flutter_secure_storage/flutter_secure_storage.dart:12:12)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #2 SecureStorageService.write (package:thuyloi_cuchi/services/secure_storage.service.dart:32:20)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #3 AuthService.login (package:thuyloi_cuchi/services/auth.service.dart:68:34)
E/flutter ( 9203): <asynchronous suspension>
E/flutter ( 9203): #4 _LoginPageState._onLogin (package:thuyloi_cuchi/pages/login.page.dart:27:19)
E/flutter ( 9203): #5 _LoginPageState.build.<anonymous closure> (package:thuyloi_cuchi/pages/login.page.dart:49:24)
E/flutter ( 9203): #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:503:14)
E/flutter ( 9203): #7 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:558:30)
E/flutter ( 9203): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 9203): #9 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9)
E/flutter ( 9203): #10 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175:7)
E/flutter ( 9203): #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter ( 9203): #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 9203): #13 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 9203): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)E/flutter ( 9203): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter ( 9203): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dartPS D:\Projects\ThuyLoiCuChi\gs-thuyloi-cuchi-mobile\thuyloi_cuchi> flutter run
Launching lib/main.dart on Redmi Note 4 in debug mode...Initializing gradle... 1.7s
Resolving dependencies... 4.7sRunning 'gradlew assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) 31.4sBuilt build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk... 5.1s
E/FlutterSecureStoragePl(18378): Registration failed
E/FlutterSecureStoragePl(18378): java.security.InvalidKeyException: Failed to unwrap key
E/FlutterSecureStoragePl(18378): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:682)
E/FlutterSecureStoragePl(18378): at javax.crypto.Cipher.unwrap(Cipher.java:2126)
E/FlutterSecureStoragePl(18378): at com.it_nomads.fluttersecurestorage.ciphers.RSACipher18Implementation.unwrap(RSACipher18Implementation.java:45)
E/FlutterSecureStoragePl(18378): at com.it_nomads.fluttersecurestorage.ciphers.StorageCipher18Implementation.<init>(StorageCipher18Implementation.java:48)
E/FlutterSecureStoragePl(18378): at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.<init>(FlutterSecureStoragePlugin.java:46)
E/FlutterSecureStoragePl(18378): at com.it_nomads.fluttersecurestorage.FlutterSecureStoragePlugin.registerWith(FlutterSecureStoragePlugin.java:33)
E/FlutterSecureStoragePl(18378): at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:25)
E/FlutterSecureStoragePl(18378): at com.example.thuyloicuchi.MainActivity.onCreate(MainActivity.java:12)
E/FlutterSecureStoragePl(18378): at android.app.Activity.performCreate(Activity.java:7009)
E/FlutterSecureStoragePl(18378): at android.app.Activity.performCreate(Activity.java:7000)
E/FlutterSecureStoragePl(18378): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
E/FlutterSecureStoragePl(18378): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
E/FlutterSecureStoragePl(18378): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
E/FlutterSecureStoragePl(18378): at android.app.ActivityThread.-wrap11(Unknown Source:0)
E/FlutterSecureStoragePl(18378): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
E/FlutterSecureStoragePl(18378): at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterSecureStoragePl(18378): at android.os.Looper.loop(Looper.java:164)
E/FlutterSecureStoragePl(18378): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/FlutterSecureStoragePl(18378): at java.lang.reflect.Method.invoke(Native Method)
E/FlutterSecureStoragePl(18378): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
E/FlutterSecureStoragePl(18378): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/FlutterSecureStoragePl(18378): Caused by: javax.crypto.IllegalBlockSizeException
E/FlutterSecureStoragePl(18378): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:519)
E/FlutterSecureStoragePl(18378): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineUnwrap(AndroidKeyStoreCipherSpiBase.java:680)
E/FlutterSecureStoragePl(18378): ... 20 more
E/FlutterSecureStoragePl(18378): Caused by: android.security.KeyStoreException: Unknown error
E/FlutterSecureStoragePl(18378): at android.security.KeyStore.getKeyStoreException(KeyStore.java:697)
E/FlutterSecureStoragePl(18378): at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
E/FlutterSecureStoragePl(18378): at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
E/FlutterSecureStoragePl(18378): ... 21 more
from flutter_secure_storage.
Please check v3.1.2.
from flutter_secure_storage.
Related Issues (20)
- > Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. HOT 2
- InfoSec Documentation for Windows is missing
- Question about files on Windows platform
- Getting values in separate isolate fails - Code: -25308, Message: User interaction is not allowed HOT 7
- Reading a specific key or using read all returns a null from the store HOT 1
- Running on web fails when _selectOptions are called
- Recording with encrypted data
- Linux read always empty
- Cannot compile my project with AGP >=8.0.0 due to R8 error HOT 2
- I am trying to save data but for some reason it is not saved on Flutter web (Chrome)
- app run crash on macos m1 pro HOT 2
- After reopen application, getting null values in IOS. But working in Android. HOT 10
- flutter_secure_storage for web get error: type LegacyJavaScriptObject is not a subtype of FutureOr<CryptoKey> HOT 1
- Error while reading data on windows HOT 1
- SHA-1 is a weak hash known to have hash collisions.
- App uses the encryption mode CBC with PKCS5/PKCS7 padding
- After reopen application, getting null values in IOS. But working in Android HOT 1
- Null check operator used on a null value
- iOS: Breaking Change from 9.1.x forward, causing loss of data HOT 3
- Datas are not removed when app is uninstalled - I0S HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_secure_storage.