systers / FirstAide-Android

FirstAide is a application to help the Peace Corps Volunteers who are victims of sexual harassment.
23 stars 104 forks source link

CircleOfTrust Crashing on Android 7.0 #397

Open abs51295 opened 7 years ago

abs51295 commented 7 years ago

Application is crashing when selecting Circle of Trust in Navigation Drawer. 20170303_201425_edited 1

The Crash Log is as follows:

03-03 20:08:54.669 20661-20661/com.peacecorps.pcsa E/AndroidRuntime: FATAL EXCEPTION: main Process: com.peacecorps.pcsa, PID: 20661 java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission. at android.os.Parcel.readException(Parcel.java:1683) at android.os.Parcel.readException(Parcel.java:1636) at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:614) at android.location.LocationManager.requestLocationUpdates(LocationManager.java:887) at android.location.LocationManager.requestLocationUpdates(LocationManager.java:471) at com.peacecorps.pcsa.circle_of_trust.LocationHelper.startAcquiringLocation(LocationHelper.java:61) at com.peacecorps.pcsa.circle_of_trust.CircleOfTrustFragment.onResume(CircleOfTrustFragment.java:204) at android.support.v4.app.Fragment.performResume(Fragment.java:2126) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1151) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1677) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:536) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6123) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

I think this is due to the unhandled runtime permissions which were introduced in API 23 and our project is using API 22. So I would suggest to make our project build on API 25 and handle these kind of corner cases.

I would like to work on this issue. Thank you.

swapsha96 commented 7 years ago

I resolved this issue by adding Run time Permissions when application starts. Can I create PR?

m-murad commented 7 years ago

You should wait for the maintainers approval.

sandarumk commented 7 years ago

@abs51295 For now let's just fix this and later have a discussion on moving to 25 or not. You can send your fix as a PR. @swapsha96 If you want to fix an issue which is reported by someone else, make sure you check the open tag.