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

Some phones don't allow access to /sdcard #1272

Closed
ghost opened this issue May 13, 2018 · 3 comments
Closed

Some phones don't allow access to /sdcard #1272

ghost opened this issue May 13, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented May 13, 2018

@RodADavison commented on Oct 22, 2017, 5:03 AM UTC:

I'm a new user of RaceCapture which is user of Kivy. I've encountered this error on my Huawei phone which throws an exception:

10-12 09:05:43.501 10388 10428 I python : [CRITICAL] [Traceback (most recent call last)]
10-12 09:05:43.501 10388 10428 I python : File "/home/brent/git-projects/RaceCapture_App/.buildozer/android/app/main.py", line 608, in
10-12 09:05:43.501 10388 10428 I python : File "/home/brent/git-projects/RaceCapture_App/.buildozer/android/app/main.py", line 168, in init
10-12 09:05:43.501 10388 10428 I python : File "/home/brent/git-projects/RaceCapture_App/.buildozer/android/platform/build/dists/racecapture/private/lib/python2.7/site-packages/kivy/app.py", line 780, in user_data_dir
10-12 09:05:43.501 10388 10428 I python : OSError: [Errno 2] No such file or directory: '/sdcard/racecapture'

I've noticed 2 related bug reports here:
#2990
#5259

The code in kivy/app.py (around line 771)
data_dir = join('/sdcard', self.name)
should be replaced using the android api requests something like:
from jnius import autoclass
env = autoclass('android.os.Environment')
data_dir = join(env.getExternalStorageDirectory().getPath(), self.name )

This issue was moved by tshirtman from kivy/kivy/issues/5448.

@ghost
Copy link
Author

ghost commented May 13, 2018

welcome[bot] commented on Oct 22, 2017, 5:03 AM UTC:

👋 Thanks for opening your first issue here! Be sure to follow the issue template!

@ghost
Copy link
Author

ghost commented May 13, 2018

@KeyWeeUsr commented on Oct 22, 2017, 6:59 PM UTC:

ref #5237, probably missed that part. I'll include it soon and hopefully even merge. :)

@ghost
Copy link
Author

ghost commented May 13, 2018

@RodADavison commented on Oct 22, 2017, 7:13 PM UTC:

Thanks for the quick and positive response KeyWee. My read of #5237, is it refers to the /sdcard reference in the get_application_config function. The one I'm referring to is in the user_data_dir function (in the same file). Perhaps this issue should be merged with 5237 and both references could be changed at the same time.
Thanks.

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

No branches or pull requests

1 participant