Use new FileProvider API for sharing data from G4L add-on
Wanted to share this issue, that I just ran in to on 2 separate devices, but both running Android 7.1.1, nAOSP ROM of Jan 2017 (from XDA). So you could dismiss this issue as 'you are a nasty tweaker' :)
From a mail from GC.com on reporting a new cache I select the cache URL in the mail and G4L is run to retrieve the new cache (so I can load it into Locus). But G4L does not have the right permissions yet, on app level in Android and a popup comes asking permission for access to the SD card: I grant it. Upon again selecting the cache's URL in the mail, then G4L reports this exception: see screenshot. It says IllegalStateException in a new popup. I double check in Settings/Apps/G4L/Permissions and I see 2 permissions (location and SDCard) and both active now. But repeating the selecting of the URL then every time the exception is thrown.
I run a logcat on this issue and save it: also attached. Some of the lines in there:
D/ActionDisplayPointsExtended(16924): Cache file for Locus: /storage/emulated/0/Geocaching4Locus/data.locus
E/UserTask(16924): An error occurred while executing doInBackground()
E/UserTask(16924): java.lang.IllegalStateException: External storage (or SD Card) is not writable.
Then again I go into Settings/Apps/G4L and I Stop the app (there is a button there for doing that). After this action, G4L will work properly and will load the cache into Locus when selecting the URL in the email. So this feels like a 'App needs to reload its permissions upon restart'. So basically, it is not a real issue for me, but it might cause confusion.
EDIT: just tried on a N9, also with nAOSP 7.1.1 ROM: first checked what the permissions are to start with: none of the permissions are set yet. I select the mail and it pop up with 'please allow bla bla', so I do. And now it DOES perfectly continue into Locus and load the cache properly . Shoot me; just wanted to share anyway :)