RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 2 of 2
Goto page Previous  1, 2
RaceCapture dies during startup on Huawei P10 Lite
Author Message
Reply with quote
Post  
I am now running my own debug version of the app. I have hacked a
try: block around the suspected line identified here:

Quote:
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'


before:
Code:
        if not exists(data_dir):
                os.mkdir(data_dir)

after:
Code:
        if not exists(data_dir):
            try:
                os.mkdir(data_dir)
            except:
                data_dir = data_dir


The app now starts and seems to run OK. I haven't tried to do much (like connect to my mk3) yet.

Oddly, creating the folder in question - /sdcard/racecapture (from the adb shell), does not change the behaviour. It still results in os.mkdir throwing the "No such file or directory" exception.

My experience with Kivy is nil and android debugging not much better. I'm happy to pursue this more, but, I'll need some direction.

Rod.

View user's profile Send private message
Reply with quote
Post  
My best guess as of right now is some Kivy/Android7/Huawei compatibility issue (perhaps exacerbated by me having configured the SD to be the default storage location). However, I'm confident that my phone has a legitimate configuration that should be handled without crashing.

When executed with the Racecapture context I get permission denied when attempting to do a os.listdir('/') and a file not found on os.listdir('/sdcard').

In my hacked version I have changed the external storage location to '/storage/2824-9CB0' instead of '/sdcard' and everything seems to be working as expected. I found this location by browsing my phone's drive. I suspect there is a proper API for extracting this info. Although the fact that '/sdcard' exists and seems to point to the same location has me thinking it could also be a permission problem.

Brent: I'll leave it to you at this point if you wish to escalate this to kivy, but I think I've found out all that I can on my own at this point.

Rod.

View user's profile Send private message
Reply with quote
Post  
Using the code from autosportlabs/racecapture/settings/systemsettings.py

Code:
            from jnius import autoclass
            env = autoclass('android.os.Environment')
            return path.join(env.getExternalStorageDirectory().getPath(), 'racecapture')


instead of the code from .buildozer/android/platform/build/dists/racecapture/private/lib/python2.7/site-packages/kivy/app.py
Code:
            data_dir = join('/sdcard', self.name)


seems to find '/storage/2824-9CB0' correctly.

The code in .../kivy/app.py should become functionally equivalent to:
Code:
            from jnius import autoclass
            env = autoclass('android.os.Environment')
            data_dir = join(env.getExternalStorageDirectory().getPath(), self.name )


This was identified as a problem in Kivy https://github.com/kivy/kivy/issues/2990
this related discussion was closed here: https://github.com/kivy/kivy/issues/5259

All the users complaining about this seem to Huawei users.

View user's profile Send private message
Reply with quote
Post  
I've reported this to kivy and it looks like fix may come with an upcoming kivy release:
https://github.com/kivy/kivy/issues/5448

View user's profile Send private message
Reply with quote
Post  
Excellent research, thank you.

You're welcome to open an issue on our repository so we can track it for the next release, and reference the Kivy issues from there.

Thanks again!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 2 of 2
Goto page Previous  1, 2
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum