Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: PlatformException (PlatformException(AuthError:Failed, Plugin not attached to any activity., null)) #1

Closed
acoutts opened this issue Feb 10, 2020 · 4 comments

Comments

@acoutts
Copy link

acoutts commented Feb 10, 2020

Can't seem to write to storage with Android, I'm getting the error:

Exception has occurred.
PlatformException (PlatformException(AuthError:Failed, Plugin not attached to any activity., null))

Here's how I'm calling it (followed how it was done in the example):

    var b = await BiometricStorage().getStorage('li.my.app',
        options: StorageFileInitOptions(authenticationRequired: true));
    await b.write('some new data');

Flutter information:

Flutter 1.12.13+hotfix.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9f5ff2306b (2 weeks ago) • 2020-01-26 22:38:26 -0800
Engine • revision a67792536c
Tools • Dart 2.7.0
@acoutts
Copy link
Author

acoutts commented Feb 10, 2020

After some digging, the activity being returned when we extend ActivityAware is not a fragment activity.

Do we need a fragment activity for this plugin to work?

More info here: flutter/flutter#43921

@hpoul
Copy link
Collaborator

hpoul commented Feb 10, 2020

Yes you do, see https://github.com/authpass/biometric_storage#android .. make sure to use the one from the embedding package.

@acoutts
Copy link
Author

acoutts commented Feb 10, 2020

Ah sorry, I meant to post earlier that I did figure it out - by doing exactly that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants