-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't write to /data/local/tmp
on Android API >= 30
#69
Comments
I spoke too soon. I am getting an error still even with the workaround:
So I have to still keep my fork of So yeah I would consider this a bug, in that in Android API level 33 |
This item has been open for 30 days with no activity. |
This item has been open for 30 days with no activity. |
This item has been open for 30 days with no activity. |
This should have been addressed with #77 and subsequently holochain/holochain#3287. Note that it is only planned to be included in holochain develop (0.3) because it is a breaking protocol change. |
This is more my way of explaining everything I've learned in my latest explorations trying to run holochain in android, than an issue in this library, although there is an error that I get in my Redmi Note 7 when running it.
So, it seems that from Android 11 (API level 30) on, Android tightened security around file system reads and writes, and doesn't allow applications to just write to
/data/local/tmp
. This is the error I get when running tx5 on android, I get it from this line.I was trying to override the result for this line by forking
dirs-rs
and redirecting theget_local_dir
call toapp_dirs2
get_app_dir, but I had no luck with this, it complained that the file didn't exist in this line (are we missing a.create(true)
in that line??). I tried to add the.create(true)
, but then I bumped into another error:InvalidArgument
, from that same function, but not sure which line...After this, I discovered this issue, and that worked! Seems that by setting the
TMPDIR
env var, we can change where thetempdir
crate creates new files. So, I can now compile and run holochain in android, by adding this workaround to my initialization code:After this, no more
permission denied
error, and networking works! I am able to communicate with a holochain node running in my laptop, and fetches for records work correctly! So this is really exciting.Now, what needs to happen with this issue and tx5, I am not sure. Maybe tx5 could itself incorporate my workaround? Not sure, but right now I'm not blocked by tx5, and the workaround is sufficiently simple and clean that it doesn't bother me at all. Maybe in the future others will bump into it though.
Thanks for the hard work! @neonphog @abe-njama
The text was updated successfully, but these errors were encountered: