Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Invalid Path? #77

Closed
Ryuinferno opened this issue Jul 1, 2014 · 10 comments
Closed

Invalid Path? #77

Ryuinferno opened this issue Jul 1, 2014 · 10 comments
Labels

Comments

@Ryuinferno
Copy link

We have been integrating the SDK into our project, it works fine in most devices expect for this one (LG Optimus 4X HD).

This is the stack trace:

06-27 23:32:10.606 18561 18561 E PayPalService: Risk component failed to initialize, threw Invalid path: /storage/emulated/0
06-27 23:32:10.906 18561 18985 W dalvikvm: threadid=21: thread exiting with uncaught exception (group=0x4184cce0)
06-27 23:32:10.916 18561 18985 E AndroidRuntime: FATAL EXCEPTION: Thread-2264
06-27 23:32:10.916 18561 18985 E AndroidRuntime: Process: com.android.settings, PID: 18561
06-27 23:32:10.916 18561 18985 E AndroidRuntime: java.lang.IllegalArgumentException: Invalid path: /storage/emulated/0
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at android.os.StatFs.doStat(StatFs.java:46)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at android.os.StatFs.<init>(StatFs.java:39)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at com.paypal.android.sdk.bj.c(Unknown Source)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at com.paypal.android.sdk.aW.g(Unknown Source)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at com.paypal.android.sdk.aW.b(Unknown Source)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at com.paypal.android.sdk.aa.a(Unknown Source)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at com.paypal.android.sdk.H.run(Unknown Source)
06-27 23:32:10.916 18561 18985 E AndroidRuntime: Caused by: libcore.io.ErrnoException: statvfs failed: EACCES (Permission denied)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at libcore.io.Posix.statvfs(Native Method)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at libcore.io.ForwardingOs.statvfs(ForwardingOs.java:132)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    at android.os.StatFs.doStat(StatFs.java:44)
06-27 23:32:10.916 18561 18985 E AndroidRuntime:    ... 6 more

Thank you

@braebot
Copy link
Contributor

braebot commented Jul 1, 2014

Thanks for the feedback. So we can better diagnose the issue, what version of the SDK are you using? Judging from the path, I assume you're using an emulator. Have you configured that correctly? An initial guess is that the SDK is probably writing something to the preferences, but the emulator is not happy.

@Ryuinferno
Copy link
Author

We are using the libraries in the master branch.
No, it's not an emulator, but it happened in the device.
http://stackoverflow.com/questions/20017468/differences-between-sdcard-emulated-0-and-sdcard

Multi user issues I guess? But phones do not have multi user support enabled, so only /storage/emulated/legacy is available

@braebot
Copy link
Contributor

braebot commented Jul 2, 2014

If you see the stack trace, you'll see there's a call from the PayPal SDK to StatFs. Perhaps we should be calling Environment.getExternalStorageDirectory() as the SO post suggests. Will need to do more digging.

@nlubello
Copy link

Same problem with the PayPalAndroidSDK, just edited the CONFIG_ENVIRONMENT to test with sandbox and the CONFIG_CLIENT_ID to match my ID.
My LogCat on Samsung S3 with CM 11 android 4.4.4:

07-14 10:05:08.621: E/PayPalService(27333): Risk component failed to initialize, threw Invalid path: /storage/emulated/0
07-14 10:05:08.891: W/dalvikvm(27333): threadid=14: thread exiting with uncaught exception (group=0x41a13ce0)
07-14 10:05:08.891: E/AndroidRuntime(27333): FATAL EXCEPTION: Thread-2630
07-14 10:05:08.891: E/AndroidRuntime(27333): Process: com.paypal.example.paypalandroidsdkexample, PID: 27333
07-14 10:05:08.891: E/AndroidRuntime(27333): java.lang.IllegalArgumentException: Invalid path: /storage/emulated/0
07-14 10:05:08.891: E/AndroidRuntime(27333):    at android.os.StatFs.doStat(StatFs.java:46)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at android.os.StatFs.<init>(StatFs.java:39)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at com.paypal.android.sdk.bj.c(Unknown Source)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at com.paypal.android.sdk.aW.g(Unknown Source)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at com.paypal.android.sdk.aW.b(Unknown Source)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at com.paypal.android.sdk.aa.a(Unknown Source)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at com.paypal.android.sdk.H.run(Unknown Source)
07-14 10:05:08.891: E/AndroidRuntime(27333): Caused by: libcore.io.ErrnoException: statvfs failed: EACCES (Permission denied)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at libcore.io.Posix.statvfs(Native Method)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at libcore.io.ForwardingOs.statvfs(ForwardingOs.java:132)
07-14 10:05:08.891: E/AndroidRuntime(27333):    at android.os.StatFs.doStat(StatFs.java:44)
07-14 10:05:08.891: E/AndroidRuntime(27333):    ... 6 more

@tomwhipple tomwhipple added the bug label Jul 28, 2014
@fechy
Copy link

fechy commented Aug 20, 2014

I had the same issue.
Adding the permission to the manifest:
< uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" / >
Fixes the issue.

@braebot
Copy link
Contributor

braebot commented Aug 20, 2014

Thanks @fechy. Obviously, we shouldn't require you to add that permission to your app. We're working on getting a fix out for this issue shortly.

@braebot
Copy link
Contributor

braebot commented Aug 22, 2014

Fixed in 2.4.0.

@braebot braebot closed this as completed Aug 22, 2014
@Pavel87
Copy link

Pavel87 commented Sep 27, 2016

What was the issue at the end?

@NinoDLC
Copy link

NinoDLC commented Oct 21, 2016

BUMP

@randstraw
Copy link

I apologize I am unfamiliar with the cause of this issue; however, I assume if you are seeing an invalid path error now with an updated release the cause would be different since this issue is from 2014. If you are seeing issues for Invalid Path with the most recent release could you create a new issue?

@paypal paypal locked and limited conversation to collaborators Nov 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants