Skip to content
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

Fix Android Platform bootstrap. #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atsushieno
Copy link

First of all, java.io.File.createtempFile() causes "permission denied"
error unless it is explicitly passed a path that is known to be writable.
http://stackoverflow.com/questions/3660572/android-createtempfile-throws-permission-denied

To fix this, we need Android's Context instance, which is expected to
be supplied by AndroidSuppport.setApplication() method (which is specific
to Android version build).
However, this File.createTempFile() is called by Platform, and Platform
class is already initialized when AndroidSupport is getting initialized.

So, the entire Platform initialization cycle is broken for Android now.

To fix this issue, I had to make API breaking change to add another
room for Android's Application (Context) outside this Platform loop
so that it can be safely initialized.

First of all, java.io.File.createtempFile() causes "permission denied"
error unless it is explicitly passed a path that is known to be writable.
http://stackoverflow.com/questions/3660572/android-createtempfile-throws-permission-denied

To fix this, we need Android's Context instance, which is expected to
be supplied by AndroidSuppport.setApplication() method (which is specific
to Android version build).
However, this File.createTempFile() is called by Platform, and Platform
class is already initialized when AndroidSupport is getting initialized.

So, the entire Platform initialization cycle is broken for Android now.

To fix this issue, I had to make API breaking change to add another
room for Android's Application (Context) outside this Platform loop
so that it can be safely initialized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant