brarcher / loyalty-card-locker

Stores your barcode-based store/loyalty cards on your phone
GNU General Public License v3.0
171 stars 29 forks source link

6.01 - Crash when accessing camera #12

Closed davidium closed 8 years ago

davidium commented 8 years ago

The app must be given permission to use the camera in Settings -> Apps -> Loyalty Card -> Permissions. If not the app crashes when scanning in a new card via camera.

I wasn't sure if this was by design, but I wanted to report it for others.

brarcher commented 8 years ago

@davidium Do you happen to know if this occurs in release v0.2? Initially I neglected to add the permission, but it was added in release v0.2.

davidium commented 8 years ago

Yes version 0.2. I believe the permission has been added, as I was able to enable it. Before I manually enabled the camera permission however, the app would crash when it tried to use the camera. I think it had trouble prompting the user for camera access, which is new in android 6.0.

Perhaps you would be able to have the app prompt this when the user opens the locker for the first time?

I hope this is helpful, let me know if there is anything I can do. Loving the app so far, and I really appreciate the work you put into it.

-David On Feb 10, 2016 5:50 PM, "Branden Archer" notifications@github.com wrote:

@davidium https://github.com/davidium Do you happen to know if this occurs in release v0.2? Initially I neglected to add the permission, but it was added in release v0.2.

— Reply to this email directly or view it on GitHub https://github.com/brarcher/loyalty-card-locker/issues/12#issuecomment-182618723 .

brarcher commented 8 years ago

I've not played with Android 6 thus far, my devices are too old. (:

Are you familiar with how one would prompt for the camera permission in Android 6, and might be interested in proposing a patch? Interestingly, the library which is used to scan the barcode mentions:

The camera permission is required for barcode scanning to function. 
It is automatically included as part of the library. On Android 6 it is 
requested at runtime when the barcode scanner is first opened.

Perhaps I am missing something in the setup, and the request is not being made...

davidium commented 8 years ago

I'm not a developer, so I can't help too much. But,

I did find this android page which looks like it might have the information. Check under the section "Request permissions you need" to see if that is of any help.

http://developer.android.com/training/permissions/requesting.html#perm-request

Also, here is "reenactment" video of the crash, and what I did to fix it. At the moment the app crashes, usually the app would request permission to use a service. This is a new feature in android 6.0.

https://youtu.be/_CH76xdVv1w

It's almost a non issue, since there is an easy fix under settings, but I wanted to make you aware anyway. :)

Hope this is helpful,

David

I've not played with Android 6 thus far, my devices are too old. (:

Are you familiar with how one would prompt for the camera permission in Android 6, and might be interested in proposing a patch? Interestingly, the library https://github.com/journeyapps/zxing-android-embedded which is used to scan the barcode mentions:

The camera permission is required for barcode scanning to function. It is automatically included as part of the library. On Android 6 it is requested at runtime when the barcode scanner is first opened.

Perhaps I am missing something in the setup, and the request is not being made...

— Reply to this email directly or view it on GitHub https://github.com/brarcher/loyalty-card-locker/issues/12#issuecomment-182678565 .

brarcher commented 8 years ago

I think the issue may have been a bug in the zxing-android-embedded library which was being used. A recent release mentions this fix for Android 6 permission support. This application is now updated to use the latest revision of zxing-android-embedded, so maybe this issue is now resolved.

When the next release is pushed to F-Droid, please take a look and see if the issue persists.

brarcher commented 8 years ago

A release has been cut, and should be picked up by F-Droid in the next day or so.

davidium commented 8 years ago

The fix works and functions as expected. Awesome job