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

Fatal Exception: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException #2684

Closed
4 tasks done
StanleyCocos opened this issue Oct 19, 2023 · 8 comments
Closed
4 tasks done
Assignees
Labels
auth Related to the Auth category/plugins bug Something isn't working transferred This issue was transferred from another Amplify project

Comments

@StanleyCocos
Copy link

StanleyCocos commented Oct 19, 2023

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

Android

Which UI component?

Authenticator

How is your app built?

Create React App

What browsers are you seeing the problem on?

Android (React Native)

Which region are you seeing the problem in?

No response

Please describe your bug.

Fatal Exception: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException
Protocol message contained an invalid tag (zero).

What's the expected behaviour?

tink-crypto/tink#504

Help us reproduce the bug!

tink-crypto/tink#504

Code Snippet

// Put your code below this line.

Console log output

No response

Additional information and screenshots

image
@lavr001 lavr001 added bug Something isn't working and removed bug Something isn't working labels Oct 19, 2023
@reesscot reesscot transferred this issue from aws-amplify/amplify-ui Oct 20, 2023
@reesscot reesscot added the transferred This issue was transferred from another Amplify project label Oct 20, 2023
@reesscot
Copy link

@StanleyCocos Transferring to Android team repo for triage

@tylerjroach
Copy link
Member

It appears that the underlying crash may have been fixed in AndroidX Security/Tink, but it is still in the alpha channel of AndroidX Security. We can pull the fix in once this hits a stable version.

Is this an edge case you are reporting or are you seeing this on a large number of devices?

@tylerjroach tylerjroach added the bug Something isn't working label Oct 20, 2023
@StanleyCocos
Copy link
Author

What I understand is that this problem should be a known problem, and the problem has been officially fixed. Next, we only need to upgrade to the official repaired version.

@StanleyCocos
Copy link
Author

tink-crypto/tink#504

@tylerjroach
Copy link
Member

@StanleyCocos As soon as there is an official version that can be used, we will pull the release in. The AndroidX security library the referenced issue is currently only in the alpha channel: https://developer.android.com/jetpack/androidx/releases/security

In the meantime, we are additionally looking into gracefully catching and recovering from the exception. Once this error is seen, the encrypted shared preferences file is corrupted and unreadable. We are looking to better attempt recreating the secure preferences file in the rare cases that this does happen.

@mattcreaser
Copy link
Member

This crash is closely related to issues like #2681. I have a workaround implementation in progress that should prevent this from crashing until such a time that we can upgrade to a newer androidx.security version.

In the meantime I'm going to transfer this to the main amplify-android repository, as this is not an issue with Authenticator itself.

@mattcreaser mattcreaser transferred this issue from aws-amplify/amplify-ui-android Jan 23, 2024
@mattcreaser mattcreaser added the auth Related to the Auth category/plugins label Jan 23, 2024
@mattcreaser mattcreaser self-assigned this Jan 23, 2024
@mattcreaser mattcreaser added the pending-release Code has been merged but pending release label Feb 8, 2024
@mattcreaser
Copy link
Member

This has been released in Amplify 2.14.10 🎉

@mattcreaser mattcreaser removed the pending-release Code has been merged but pending release label Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Related to the Auth category/plugins bug Something isn't working transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

5 participants