bitwarden / mobile

Retired Bitwarden mobile app for iOS and Android (MAUI/Xamarin).
https://bitwarden.com
GNU General Public License v3.0
32 stars 4 forks source link

Android app force closes on start #264

Closed 7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH closed 6 years ago

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

Logcat attached. Device is a Leeco Le Pro 3. Error has occured on Omnirom, AICP and Paranoid Android for this device. (7.x Nougat) Fresh install. Using OpenGapps.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

01-23 23:01:06.816 11841 11841 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The configuration is invalid. Creating the instance for type ISecureStorageService failed. Key not yet valid ---> SimpleInjector.ActivationException: Key not yet valid ---> Java.Security.InvalidKeyException: Key not yet valid

Namely

Java.Security.InvalidKeyException: Key not yet valid

This is the error. For some reason that device doesn't work with the Android Keystore. Any idea why?

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

Other than the fact it's a no name phone no idea. Ironically I got it to work one time then could never recreate it so I know it CAN be done but not what was different. Do we perhaps need different lines in build.prop to tell it a different device?

YP5qt8lRO1BOW1Dm8ufPYTguaPnpGod8GkzzfgC commented 6 years ago

Same issue here.....really sucks as i use the mobile app a lot. same device leeco le pro 3

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

Which Rom are you on mzarglis? Factory?

YP5qt8lRO1BOW1Dm8ufPYTguaPnpGod8GkzzfgC commented 6 years ago

AICP 13.1 (8.1.x)

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

I'm updating this because a user running the same rom was able to use the app...the two main differences were I was on opengapps mini and they were on opengapps stock. I also had magisk v15.3 installed. I flashed the same rom along with opengapps mini and it still crashed eliminating magisk. I'm now downloading opengapps "stock" to see if that resolves the issue.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

We've also seen this same problem on some older Samsung Devices (Galaxy S3 and S4). It's still known why those do not work with Android Keystore either, but I've found several cases documented online by others also confirming the problem.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

A clean install of AICP 12.1 rom (7.x) is able to install and run the bitwarden mobile app. It is the only rom I found that could do so among various I tried with both nougat and oreo bases. I have no idea what is significant.

YP5qt8lRO1BOW1Dm8ufPYTguaPnpGod8GkzzfgC commented 6 years ago

yeah it worked for me on AICP 12.1 before i upgraded to 13.1

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

I tried bitwarden on an Android Oreo Rom available for this device and got an identical abend. On the off chance it was a different error or explained better I've attached a logcat.txt from THAT rom.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

@famewolf It's the same exception with the Android Keystore.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

I've reported the issue to a couple of our Rom developers but not sure what priority it is with them since they don't use bitwarden. If I reflashed AICP 12.1 where it works is there anything I could do that would help identify whats different about it against the other 7 rom's I tried?

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

Just share the above exception with them that occurs when trying to use the Android Keystore.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

I did and even linked to this ticket but most don't seem to consider it a high priority item since none of them use bitwarden and no other apps seem to have the same problem. For example lastpass works as expected. I appreciate all the time you took looking at this. Wish I could think of something to help resolve the issue.

DLlnA81eVflngcRamj4WEzNlTAh48WEDwmjGZm8 commented 6 years ago

Same issue on Miui 9 with Android 7.0.

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

I'm experiencing this issue on a LeEco LePro 3 X727 with LineageOS 15.1 cleanly installed. Note: I do not install Google Play Services nor do I have any intention of doing so. FWIW, Bitwarden's mobile app worked just fine on the same phone with LineageOS 14.1 without Google Play Services.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

I am on the 03/05 LeEco LePro 3 X727 with LineageOS 15.1 release which is the most recent official release. Bitwarden runs fine here so it does appear to be rom specific. I do have Google Play Services installed. (and did when I originally posted this issue)

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

@famewolf We literally have the same setup except you have Google Play Services and I don't. Interesting. FWIW, Bitwarden still crashes on launch for me with the 3/5 build.

f4FUtMNorkixiI38DcJufc0TCCauIjYGLsQoa2j commented 6 years ago

Some update of the issue or solution?

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

Still happening for me even with the latest APK of the Bitwarden App from APKPure.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 6 years ago

Not really much of an update but I switched to LineageOS 15.1 for the LeEco Le Pro 3 as well as opengapps mini and the issue went away. Opengapps mini was needed for google camera to work. Beangapps did NOT work so it's possible it also had something bitwarden needed. Might be worth testing. I eventually had settled on just using lastpass becuase of the hotkeys to use default form profile as well as ability to add credit cards and select which one to fill. Was "clumsier" in bitwarden. I'll re-evaluate farther down the line.

YP5qt8lRO1BOW1Dm8ufPYTguaPnpGod8GkzzfgC commented 6 years ago

The issue has been resolved for me as well since upgrading to AICP 13.1, now that i think of it i think i was using beangapps aswell and have since switched to opengapps.

But anyways no more force closes on my leeco le pro 3 on latest AICP 13.1 nightly with latest opengapps

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

The Bitwarden Android app shouldn't require Google Play Services (opengapps) to be present on an Android device and it appears that based on the other posts in this thread, it now requires exactly that. This is a disturbing trend that I hope will be reversed in short order.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

Play services is not required to run the app. We can run the app in a simulator without google apps and it works fine. There is also an f droid version if the app available in the releases page which doesn’t have any google play service libraries in it.

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

So I did some digging after looking at the code for this and stumbled upon this issue:

https://github.com/iamMehedi/Secured-Preference-Store/issues/15

It looks like somebody suggested removing the start and end dates from the keystore and somebody at the end confirmed that this resolved their very similar issue. I notice the bitwarden code seems to be setting both of them. Might this change be worth a shot?

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

Also, I found the PR that was merged to deal with the issue on their end. Looks like a pretty simple set of changes... I'd do it myself, but I don't have a proper build environment setup (Windows + Visual Studio) to do and test the work myself.

https://github.com/iamMehedi/Secured-Preference-Store/pull/27

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

I created a build them them removed: https://github.com/bitwarden/mobile-maui/commit/14d1d132a3b7622573af21793916ac2df9b537d7

Our CI system is having issues at the moment so I can't provide a apk yet. Will be available here when that starts working: https://ci.appveyor.com/project/bitwarden/mobile/build/artifacts

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

@jaylittle You can try the apk here now: https://ci.appveyor.com/project/bitwarden/mobile/build/artifacts

nHgQxtonSgNL0TFOC2bZVYY20yU29B3VPCT1z2g commented 6 years ago

Wow. That worked. Using that fdroid apk, I was finally able to actually use BitWarden on my LeEco LePro 3 phone with Lineage OS 15.1 sans Google Play Services for the very first time. Thank you! Hopefully others in this thread can confirm this fix as well and experience some relief.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 6 years ago

This is pushed to the latest play store beta. Will go out in the next version.

hhdF9zxwFtoYgXeFgux2PrnhHtuWUVY97JbM2KB commented 6 years ago

This issue is not resolved. I try to use the app on a Sony xperia z1 with the latest stock rom and it crashes every time on Startup. I don't have my phone rooted so I don't now how to obtain any logs. I did send two crash reports.

BI2Wcffn2Ep2U1cO6SsgTaR5WyoYeHP6ufGefG2 commented 5 years ago

Has there been a fix for this yet? I'm on a Le Eco Pro 3 with the latest AICP 14.0 ROM installed, and Bitwarden wont even open.

I'd really love to use it but won't be able to without it working on my phone!

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 5 years ago

@mjarsenault Do you have at logs available from the phone?

BI2Wcffn2Ep2U1cO6SsgTaR5WyoYeHP6ufGefG2 commented 5 years ago

@mjarsenault Do you have at logs available from the phone?

(I hope I did this right)

01-16 08:33:25.133 935 1059 I ActivityManager: Start proc 
21724:com.x8bit.bitwarden/u0a175 for activity 
com.x8bit.bitwarden/md5b95ad25b85f158431f24aa9fc17a1c1e.SplashActivity
01-16 08:33:27.348 21724 21724 E AndroidRuntime: FATAL EXCEPTION: main
01-16 08:33:27.348 21724 21724 E AndroidRuntime: Process: 
com.x8bit.bitwarden, PID: 21724
01-16 08:33:27.348 21724 21724 E AndroidRuntime: 
android.runtime.JavaProxyThrowable: 
System.Reflection.TargetInvocationException: Exception has been thrown by 
the target of an invocation. ---> System.InvalidOperationException: The 
configuration is invalid. Creating the instance for type 
ISecureStorageService failed. Key not yet valid ---> 
SimpleInjector.ActivationException: Key not yet valid ---> 
Java.Security.InvalidKeyException: Key not yet valid
7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 5 years ago

On the Leeco Pro 3, the problem appears to be some of the Rom's available. For example Lineage 15.1 does not give the error nor does the latest AICP as far as I know. You seem to be on an older version? Try one of the ones with Oreo or Pie and the problem should go away. I personally run Lineage 15.1 (and am looking at Lineage 16..given you'll have to do a clean install to jump a version you might as well go all the way to pie) on my LeEco Pro 3.

BI2Wcffn2Ep2U1cO6SsgTaR5WyoYeHP6ufGefG2 commented 5 years ago

I'm on the January 10th (latest) release of AICP 14.0, which is a Pie ROM.

7HadCY9jVemjIleJrcY0NdtXzMIYpJ8H4W0AcuH commented 5 years ago

I'm on the January 10th (latest) release of AICP 14.0, which is a Pie ROM.

Interesting. Well obviously something has changed then because I recall reading earlier users on AICP saying it was working at the time...perhaps it worked on AICP Oreo and doesn't work on pie. Perhaps you can point out the issue to the rom developer and indicate the app DOES work on Lineage15.1. It's possible he can find out what the issue is. I would also perhaps try a couple of different gapps versions (I'm on opengapps mini).

Realistically there is not much the bitwarden guys can do since on factory rom's the app will work as it should and the problem appears to be specific to custom roms/versions. (sadly ALL our rom's are considered custom since the manufacturer abandoned support back when it was on marshmallow..it's still a heck of a device and the price for me was hard to beat)