buildozer.spec and android.permissions = WRITE_EXTERNAL_STORAGE fails compile

1,685 views
Skip to first unread message

Gary Kuipers

unread,
Feb 24, 2023, 2:37:03 PM2/24/23
to Kivy users support
When I reinstall my app I lose access to photos stored by the app. If I erase and reinstall it asks for the other permissions (CAMERA, GPS, AUDIO but not the STORAGE permissions.  NOte that my app does NOT ask for audio but the buildozer.spec does, su it must come from there

The solution, so they say, is to add WRITE_EXTERNAL_STORAGE to android.permissions

No such luck:

when I  buildozer -v android debug I with the buildozer.spec that includes the line:
    android.permissions = WRITE_EXTERNAL_STORAGE
I get the following error:
Command failed: /home/gary/PycharmProjects/YSI_Read/venv/bin/python -m pythonforandroid.toolchain apk --bootstrap sdl2 .... etc.

The only difference in source is the presence/absence of that one permission.
 
Any ideas?



Robert

unread,
Feb 24, 2023, 4:14:21 PM2/24/23
to Kivy users support


WRITE_EXTERNAL_STORAGE is not the solution on any modern Android device.

If you want persistence between app new installs use shared storage
If you want persistence between app updates use the app storage directory

Robert

unread,
Feb 25, 2023, 1:46:17 AM2/25/23
to Kivy users support
On re-reading your question, I wonder if my answer was off target? In which case I didn't understand the question.
Message has been deleted
Message has been deleted
Message has been deleted

Robert

unread,
Feb 25, 2023, 3:58:15 PM2/25/23
to Kivy users support
> I keep replying to this conversation but somehow my replies get deleted. This is the THIRD time am replying, I am doing a "reply to author" to se if that works better. I have also had new conversation disappear without a trace. Mentioned it to Elliot. He said it seemed weird. Any ideas?

Anyhow, I have taken to logging my posts to a notepad just in case this happens. First post was long and detailed. Second post was shorter. This one will be really short.

From my reading: I'd like you to check my logic.

1) I thought the debug +  adb install -r bin/*.apk was an update. It is an install. This explains files and jsonstores becoming inaccessible when iterating compiles.
2) Private is a filesystem. androidstorage4kivy is built on Private. Jsonstore is on private. I can expect any of these to become inaccessible when compiling new version in development.
3) My conclusion is that during development I should only use androidstorage4kivy Shared. 

Is this correct?

1) its is an 'install update'

2) the lifetime of private files depends where they are located https://github.com/Android-for-Python/Android-for-Python-Users#private-storage

3) 'should' I can't say,
'could' yes,
'must' no.
Reply all
Reply to author
Forward
0 new messages