Android app crash when scanning TOTP QR Code #1186

Closed
opened 2025-11-26 22:41:27 -06:00 by GiteaMirror · 30 comments
Owner

Originally created by @sso-bitwarden on GitHub (Jan 20, 2021).

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
Originally created by @sso-bitwarden on GitHub (Jan 20, 2021). ## 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
Author
Owner

@bchociej commented on GitHub (Jan 20, 2021):

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.

@bchociej commented on GitHub (Jan 20, 2021): 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.
Author
Owner

@JOduMonT commented on GitHub (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.
https://github.com/bitwarden/mobile/issues/1157

@JOduMonT commented on GitHub (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. https://github.com/bitwarden/mobile/issues/1157
Author
Owner

@isaialcantara commented on GitHub (Feb 17, 2021):

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.

@isaialcantara commented on GitHub (Feb 17, 2021): 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.
Author
Owner

@kendratodd commented on GitHub (Mar 11, 2021):

Similar reports from https://github.com/bitwarden/mobile/issues/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

@kendratodd commented on GitHub (Mar 11, 2021): Similar reports from https://github.com/bitwarden/mobile/issues/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
Author
Owner

@tverspeelt commented on GitHub (Mar 23, 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.

@tverspeelt commented on GitHub (Mar 23, 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.
Author
Owner

@YpsilonOmega commented on GitHub (Apr 2, 2021):

It appears that I've got the same issue:

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

@YpsilonOmega commented on GitHub (Apr 2, 2021): It appears that I've got the same issue: Device: Galaxy XCover 5 - SM-G525F/DS OS: Android 11 Build Version: 2.9.1
Author
Owner

@sambartle commented on GitHub (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)

@sambartle commented on GitHub (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)
Author
Owner

@Matan commented on GitHub (Apr 10, 2021):

Same issue for me:

Device: Samsung A50
OS: Android 11
Build: 2.9.1

@Matan commented on GitHub (Apr 10, 2021): Same issue for me: Device: Samsung A50 OS: Android 11 Build: 2.9.1
Author
Owner

@Ksathral commented on GitHub (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.

@Ksathral commented on GitHub (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.
Author
Owner

@rlipscombe commented on GitHub (Aug 31, 2021):

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

@rlipscombe commented on GitHub (Aug 31, 2021): Pixel 5. Crashes on Facebook TOTP setup; works fine on AWS Virtual MFA setup.
Author
Owner

@cwille97 commented on GitHub (Sep 5, 2021):

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

@cwille97 commented on GitHub (Sep 5, 2021): Same issue: Google Pixel 3a XL Android 11 App version 2.12.0
Author
Owner

@Akryum commented on GitHub (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

@Akryum commented on GitHub (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
Author
Owner

@estevanbs commented on GitHub (Sep 21, 2021):

Same here.

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

@estevanbs commented on GitHub (Sep 21, 2021): Same here. Android 11 (Lineage OS 18.1) SM-M205M Bitwarden 2.12.0
Author
Owner

@webprez commented on GitHub (Oct 2, 2021):

Same here.

@webprez commented on GitHub (Oct 2, 2021): Same here.
Author
Owner

@josiah-roberts commented on GitHub (Oct 24, 2021):

+1, only occasionally crashes for me.

@josiah-roberts commented on GitHub (Oct 24, 2021): +1, only occasionally crashes for me.
Author
Owner

@sso-bitwarden commented on GitHub (Nov 10, 2021):

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

@sso-bitwarden commented on GitHub (Nov 10, 2021): +1 Device: Samsung J6 Operating system: Android 10 Build Version 2.14.2 Is this a Beta release? No
Author
Owner

@fmbarina commented on GitHub (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.

@fmbarina commented on GitHub (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.
Author
Owner

@vvolkgang commented on GitHub (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 commented on GitHub (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](https://github.com/bitwarden/mobile/actions/runs/1825356551) 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
Author
Owner

@aouerf commented on GitHub (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.

@aouerf commented on GitHub (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`.
Author
Owner

@Larry-Sussman commented on GitHub (Feb 14, 2022):

This has been addressed by https://github.com/bitwarden/mobile/pull/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.

@Larry-Sussman commented on GitHub (Feb 14, 2022): This has been addressed by https://github.com/bitwarden/mobile/pull/1759 and should be resolved in the mobile app [v2.16.2](https://github.com/bitwarden/mobile/tree/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.
Author
Owner

@aouerf commented on GitHub (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.

@aouerf commented on GitHub (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.
Author
Owner

@fmbarina commented on GitHub (Feb 15, 2022):

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)

@fmbarina commented on GitHub (Feb 15, 2022): 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)
Author
Owner

@vvolkgang commented on GitHub (Feb 15, 2022):

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

@vvolkgang commented on GitHub (Feb 15, 2022): @fmbarina can you provide reproduction steps? We believe that's a different issue and we've been unable to replicate it yet.
Author
Owner

@fmbarina commented on GitHub (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.

@fmbarina commented on GitHub (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](https://stefansundin.github.io/2fa-qr/) - 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.
Author
Owner

@kosmoz commented on GitHub (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)

@kosmoz commented on GitHub (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)
Author
Owner

@Greenderella commented on GitHub (May 5, 2022):

This issue appears to still be present on version 2.18.0

@Greenderella commented on GitHub (May 5, 2022): This issue appears to still be present on version 2.18.0
Author
Owner

@develop7 commented on GitHub (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.

@develop7 commented on GitHub (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.
Author
Owner

@fedemkr commented on GitHub (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.

@fedemkr commented on GitHub (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.
Author
Owner

@develop7 commented on GitHub (Jun 7, 2022):

@fedemkr any beta releases before that?

@develop7 commented on GitHub (Jun 7, 2022): @fedemkr any beta releases before that?
Author
Owner

@fedemkr commented on GitHub (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)

@fedemkr commented on GitHub (Jun 7, 2022): Hi, @develop7 you can grab the apk from [Github Action Artifacts](https://github.com/bitwarden/mobile/actions/runs/2455389590) 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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1186