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 app crash when scanning TOTP QR Code #1228

Closed
sso-bitwarden opened this issue Jan 20, 2021 · 30 comments · Fixed by #1759 or #1942
Closed

Android app crash when scanning TOTP QR Code #1228

sso-bitwarden opened this issue Jan 20, 2021 · 30 comments · Fixed by #1759 or #1942

Comments

@sso-bitwarden
Copy link

Describe the Bug

App crash when scanning QR code to add TOTP

Steps To Reproduce

  1. Scan TOTP QR Code

Expected Result

TOTP configured

Actual Result

App crash and back to Android home screen

Screenshots or Videos

Environment

  • Device: Google Pixel 2
  • Operating system: Android 11
  • Build Version 2.6.1
  • Is this a Beta release? N
@bchociej
Copy link

Hi, I am the one who reported the bug via email to support@bitwarden.com, and Sugianto kindly logged this issue for me. Happy to provide more info as needed.

@JOduMonT
Copy link

JOduMonT commented Feb 10, 2021

Hi @juristat;

I would like effectively more info since it also happen on my new phone and I had previously opened an issue for the same kind of behavior.

My new phone is an Samsung Galaxy S8 (SM-G950F) "dreamlte" with Android Pie (9) I have the same issue with the Bitwarden app version 2.6.1.

Previously I opened this issue but it was for a different phone.
bitwarden/mobile#1157

@isaialcantara
Copy link

The same happens on a Samsung Galaxy J4 (2018). The camera viewfinder is somewhat narrower and the app crashes when it sees the QR code.

@kendratodd
Copy link

kendratodd commented Mar 11, 2021

Similar reports from bitwarden/mobile#1289:

Device: Google Pixel 3
Operating system: Android 11 RQ1A.210205.004
Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349)
Is this a Beta release? No

@tverspeelt
Copy link

I have the same issue. It seems to only happen on 'complex' QR codes.

My workaround is to use Google Lens to get the URL from the QR, and paste the URL in Bitwarden.

@YpsilonOmega
Copy link

It appears that I've got the same issue:

Device: Galaxy XCover 5 - SM-G525F/DS
OS: Android 11
Build Version: 2.9.1

@sambartle
Copy link

sambartle commented Apr 2, 2021

I have the same issue. It seems to only happen on 'complex' QR codes.

My workaround is to use Google Lens to get the URL from the QR, and paste the URL in Bitwarden.

I've never found one that cant be scanned in my case it just takes multiple attempts.
The complexity doesn't seem to matter in my case, its truly random as far as I can tell.

Device: Google Pixel 3
Operating system: Android 11 RQ1A.210205.004
Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349)

@Matan
Copy link

Matan commented Apr 10, 2021

Same issue for me:

Device: Samsung A50
OS: Android 11
Build: 2.9.1

@Ksathral
Copy link

Ksathral commented Jun 6, 2021

I have never been able to scan a QR code from within the bitwarden app, it crashes on both official and custom roms (Android 7/8/9/10 all basd on Samsung oneui on my Galaxy S7 G930-F. The only time I did got it to work was when I used an AOSP based rom ( Android 9).

I just use a seperate QR code scanning app and copy / paste the url into the Bitwarden apps TOTP field to get it it to work.

@rlipscombe
Copy link

rlipscombe commented Aug 31, 2021

Pixel 5. Crashes on Facebook TOTP setup; works fine on AWS Virtual MFA setup.

@cwille97
Copy link

cwille97 commented Sep 5, 2021

Same issue:
Google Pixel 3a XL
Android 11
App version 2.12.0

@Akryum
Copy link

Akryum commented Sep 7, 2021

Crashes on any QR code scanning, wasn't able to make it work on Pixel 4a | Android 11 | Bitwarden 2.12.0

@estevanbs
Copy link

Same here.

Android 11 (Lineage OS 18.1)
SM-M205M
Bitwarden 2.12.0

@eliykat eliykat mentioned this issue Sep 29, 2021
1 task
@webprez
Copy link

webprez commented Oct 2, 2021

Same here.

@josiah-roberts
Copy link

+1, only occasionally crashes for me.

@sso-bitwarden
Copy link
Author

+1
Device: Samsung J6
Operating system: Android 10
Build Version 2.14.2
Is this a Beta release? No

@fmbarina
Copy link

fmbarina commented Dec 3, 2021

+1, ocasional crashes.

Device: Asus Zenphone 3 Zoom (ZE553KL)
Operating system: Android 8
Build Version 2.14.2 (4005)
Is this a Beta release? N

I've tried to better understand what causes this, to make adding 2FA less of a hassle and hopefully help whoever looks into this in the future. But even testing different methods in different circumstances many times didn't lead me to any clear conclusion. A previous version of this comment said it did, which recently proved false upon further testing. I apologize for that, this is confusing.

@fedemkr fedemkr linked a pull request Feb 9, 2022 that will close this issue
8 tasks
@vvolkgang
Copy link
Member

vvolkgang commented Feb 10, 2022

Thanks everyone for the info! We weren't able to replicate this in multiple devices but we suspect the linked PR changes will fix it. If you previously had this issue, can you download the .apk from our CI and test it please?

Obligatory disclaimer: This isn't an official release that went through regression testing, there might be other unrelated issues overall, we just want to be sure this TOTP crash is fixed.

Issue was automatically closed due to being linked in the PR but I'm reopening this until we figure it out.

Edit: Updated the CI link

@vvolkgang vvolkgang reopened this Feb 10, 2022
fedemkr added a commit that referenced this issue Feb 11, 2022
* master: (34 commits)
  check email for null before authenticating (#1769)
  remove datepicker style workaround (#1768)
  Bump version to 2.16.2 (#1765)
  Improved code for periodic Autofocus on scan for better cancellation and task handlilng (#1764)
  Updated Sed expression for Android manifests (#1763)
  Bumped version to 2.16.1 (#1762)
  Add iOS Share Extension to our version bump automation (#1761)
  Bumped version to 2.16.0 (#1760)
  Improved Autofocus code on ScanPage for better cancellation and exception handling #1228 (#1759)
  [Help] Update links to new pattern (#1758)
  Client & Version headers (#1757)
  Autosync the updated translations (#1752)
  Fix delete account SSO with CME that the OTP parameter was being sent incorrectly to the server (#1751)
  [Icons] Fast follower changes (#1750)
  Removed punctuation on some string resources regarding send (#1747)
  Set background of biometricCell from theme (#1744)
  Cleared About information about push registration, just left it in DEBUG mode (#1742)
  Cleared Console.WriteLine for iOS push notifications issue (#1739)
  Autosync the updated translations (#1734)
  Update FA icons on LockPasswordViewController (#1729)
  ...
fedemkr added a commit that referenced this issue Feb 14, 2022
* master:
  [Icons] - BUG - Update groupings icon for collections (#1773)
  Autosync the updated translations (#1766)
  check email for null before authenticating (#1769)
  remove datepicker style workaround (#1768)
  Bump version to 2.16.2 (#1765)
  Improved code for periodic Autofocus on scan for better cancellation and task handlilng (#1764)
  Updated Sed expression for Android manifests (#1763)
  Bumped version to 2.16.1 (#1762)
  Add iOS Share Extension to our version bump automation (#1761)
  Bumped version to 2.16.0 (#1760)
  Improved Autofocus code on ScanPage for better cancellation and exception handling #1228 (#1759)
  [Help] Update links to new pattern (#1758)
  Client & Version headers (#1757)
  Autosync the updated translations (#1752)
  Fix delete account SSO with CME that the OTP parameter was being sent incorrectly to the server (#1751)
  [Icons] Fast follower changes (#1750)
  Removed punctuation on some string resources regarding send (#1747)

# Conflicts:
#	src/Android/Properties/AndroidManifest.xml
#	src/iOS.Autofill/Info.plist
#	src/iOS.Extension/Info.plist
#	src/iOS.ShareExtension/Info.plist
#	src/iOS/Info.plist
@aouerf
Copy link

aouerf commented Feb 14, 2022

The issue I'm getting happens the second time I try to scan a QR code without restarting the app. The crash message is java.lang.RuntimeException: Camera is being used after Camera.release() was called.

@Larry-Sussman
Copy link
Member

This has been addressed by bitwarden/mobile#1759 and should be resolved in the mobile app v2.16.2. Please let us know if this crash still occurs after this update. I'm leaving this issue open as @vvolkgang mentioned until we can confirm the fix.

@aouerf
Copy link

aouerf commented Feb 14, 2022

I thought that I installed the update before reporting, but I guess not; this was a mistake on my part. After updating and testing, I can confirm that the latest build fixed the issue for me.

@fmbarina
Copy link

Happy to see progress on this, but sadly it still occasionally crashes here. Adb logcat also shows java.lang.RuntimeException: Camera is being used after Camera.release() was called.

Device: Asus Zenphone 3 Zoom (ZE553KL)
Operating system: Android 8
Build Version 2.16.2 (4334)

@vvolkgang
Copy link
Member

@fmbarina can you provide reproduction steps? We believe that's a different issue and we've been unable to replicate it yet.

@fmbarina
Copy link

fmbarina commented Feb 15, 2022

I wish I could provide more helpful information - and do tell me if I'm doing this wrong. But I just...

  1. Open bitwarden app (after restarting phone just to be safe)
  2. Add new item (tap + icon)
  3. Tap scan button with camera already pointed at a generic test QR code
  • secret = SY3SJKJCWOFJQC6XHIP5RWWYV4DQNGQE
  • label = Label
  • issuer = Issuer

And upon trying to scan, sometimes it crashes.
I'm willing to try to reproduce the issue with other tools if that'd be any help, I just don't know what those would be.

@kosmoz
Copy link

kosmoz commented Feb 18, 2022

I am also experiencing this issue.

The camera works fine until it "sees" the QR code, then the app crashes.

(2.16.2 on Xiaomi Mi5s running LineageOS 16, Android 9)

@Greenderella
Copy link
Member

This issue appears to still be present on version 2.18.0

@develop7
Copy link

develop7 commented Jun 6, 2022

I'm affected by the issue as well, version 2022.05.0 on Pixel 5 running Android 12 (security update May 5, 2022). Bitwarden app crashes on first attempt to scan the QR code; scanning the code after reopening the app after crash succeeds though.

@fedemkr fedemkr linked a pull request Jun 6, 2022 that will close this issue
9 tasks
@fedemkr
Copy link
Member

fedemkr commented Jun 6, 2022

Thanks a lot for all the feedback, this is happening because of a racing issue so it's quite difficult to reproduce consistently, but a fix has been applied in #1942 and will be available in June's release. Please let us know if this keeps happening after the release, thanks.

@develop7
Copy link

develop7 commented Jun 7, 2022

@fedemkr any beta releases before that?

@fedemkr
Copy link
Member

fedemkr commented Jun 7, 2022

Hi, @develop7 you can grab the apk from Github Action Artifacts and try it to see if that solves your issue but beware that the app may not be stable given that it's a development build and it hasn't been tested thoroughly by the test team yet.
Also, we're going to ship it to the beta channel before the final June release so you can wait for that as well to have more things included and better stability (just in case here also applies that it's not the final release so issues may appear during beta testing but much less than development build)

vvolkgang pushed a commit that referenced this issue Jun 20, 2024
Co-authored-by: David Perez <david@livefront.com>
vvolkgang pushed a commit that referenced this issue Jun 20, 2024
Co-authored-by: David Perez <david@livefront.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet