fixes find_library when deployed external storage#1291
Conversation
Fixes `find_library()` `OSError`/`FileNotFoundError` exception when app deployed external SD storage. Apps deployed on external SD storage have different root prefix. External SD storage apps root dir prefix is like: ``` /mnt/expand/<sd-card-id>/user/0/<package.domain>.<package.name>/files/app ``` While internal storage apps root dir prefix is: ``` /data/data/<package.domain>.<package.name>/files/app ``` Hence the `[0:4]` trick doesn't work.
|
Looks good, did you test it on a device in the end? If not I'll try to do that before merging. |
|
Yes I'm using that fix in one of my apps with monkey patching here: When the fix is not applied the app crashes when deployed on SD card. With the fix it's OK. |
|
Great, thanks. I'm delighted that this probably fixes some of the mysterious crashes I've heard of but never been able to diagnose. |
|
Great thanks for the merge. I hope so for the crashes. For records here are some stack trace from these crashes: |
Fixes
find_library()OSError/FileNotFoundErrorexception when appdeployed external SD storage.
Apps deployed on external SD storage have different root prefix.
External SD storage apps root dir prefix is like:
While internal storage apps root dir prefix is:
Hence the
[0:4]trick doesn't work.