java.io.FileNotFoundException: open failed: EACCES (Permission denied)
See original GitHub issueHello,
My application is crashing only when running on Android 5.X. Here are the details about the error:
Error Stacktrace:
FATAL EXCEPTION: main
Caused by: java.io.FileNotFoundException: /data/data/APP_ID/lib-main/dso_lock: open failed: EACCES (Permission denied)
FATAL EXCEPTION: main
Process: APP_ID:p54993bdf2c8b1ed6b7cda959, PID: 10210
java.lang.RuntimeException: Unable to create application APP_ID.MainApplication: java.lang.RuntimeException: java.io.FileNotFoundException: /data/data/APP_ID/lib-main/dso_lock: open failed: EACCES (Permission denied)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /data/data/APP_ID/lib-main/dso_lock: open failed: EACCES (Permission denied)
at com.facebook.soloader.SoLoader.init(SoLoader.java:192)
at APP_ID.MainApplication.onCreate(MainApplication.java:52)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
... 9 more
Caused by: java.io.FileNotFoundException: /data/data/APP_ID/lib-main/dso_lock: open failed: EACCES (Permission denied)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
at com.facebook.soloader.FileLocker.<init>(FileLocker.java:35)
at com.facebook.soloader.FileLocker.lock(FileLocker.java:31)
at com.facebook.soloader.UnpackingSoSource.prepare(UnpackingSoSource.java:417)
at com.facebook.soloader.SoLoader.initSoSources(SoLoader.java:304)
at com.facebook.soloader.SoLoader.init(SoLoader.java:181)
at com.facebook.soloader.SoLoader.init(SoLoader.java:164)
at com.facebook.soloader.SoLoader.init(SoLoader.java:190)
... 12 more
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
... 21 more
Enviroment:
System:
OS: macOS 11.6.1
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 63.66 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.8.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.21.0 - /usr/local/bin/npm
Watchman: 2021.08.23.00 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
Android SDK:
API Levels: 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
System Images: android-22 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7486908
Xcode: 13.0/13A233 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Details
The error happens when opening the application, only on Android 5.X versions.
Already tried to add android:requestLegacyExternalStorage="true"
to the AndroidManifest.xml, with no success.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
open failed: EACCES (Permission denied) - Stack Overflow
It turns out I am calling open and close FileOutputStream too frequently, which throws the FileNotFoundException at some point. Sounds more like ...
Read more >How to solve Android Emulator java.io.FileNotFoundException ...
To fix this problem it is necessary to go to Settings – Apps – My App – Permission. Access to Storage is probably...
Read more >Android Q java.io.FileNotFoundException: open failed ...
Hi, I have an issue related to the android 10 or Q in which when picking an image from gallery the app crashes...
Read more >Android 10 open failed: EACCES (Permission denied) - Medium
Running this workflow on an Android 10 device failed to upload the images. The error we saw was open failed: EACCES (Permission denied)....
Read more >How to Fix Exception 'open failed: EACCES (Permission ...
It is very simple to resolve Exception 'open failed: EACCES (Permission denied)' Go to the project pane and Click on AndroidManifest and add ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@simpleton this is the version used by React Native by default.
Do you know if we have a recommended version to upgrade? I can try to do this and check if solve this issue ( I’m only worried because it is the version chosen by react-native to be used ).
It’s too old…
On Fri, Nov 19, 2021 at 3:20 PM Felipe Augusto @.***> wrote: