question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.io.FileNotFoundException: open failed: EACCES (Permission denied)

See original GitHub issue

Hello,

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fansilva1991commented, Nov 25, 2021

@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 ).

1reaction
simpletoncommented, Nov 20, 2021

It’s too old…

On Fri, Nov 19, 2021 at 3:20 PM Felipe Augusto @.***> wrote:

@simpleton https://github.com/simpleton sorry for the late response.

This is the version I’m using.

[image: Screen Shot 2021-11-19 at 20 19 45] https://user-images.githubusercontent.com/4633618/142703173-40aa016d-c24c-41fc-98c8-8158735eb5a0.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/SoLoader/issues/88#issuecomment-974535036, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADO6YSKA4TD2NMJD5GEEI3UM3LS3ANCNFSM5HZHSVOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found