Caused by: libcore.io.ErrnoException: open failed: EACCES (P

本文探讨了在特定情况下Android应用程序无法在SDCARD内创建文件或文件夹的问题,并提供了可能的解决方案。文章引用了相关讨论链接,分析了权限和应用程序类型如何影响SDCARD的访问。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天碰到一个奇葩的问题,写的软件不能再SDCARD里面写文件或者新建文件夹,弄了好久发现这里面有个网友回答出来了

http://www.dewen.org/q/4827/Android4.0%E4%B8%8D%E8%83%BD%E5%9C%A8SD%E5%8D%A1%E5%88%9B%E5%BB%BA%E7%9B%AE%E5%BD%95%3F

当应用程序是system时,不能访问SDCARD

为什么会这样呢?在另外的源码里面编译的该软件能够正常访问SDCARD!

更多答案:

http://www.eoeandroid.com/thread-63314-3-1.html

http://www.2cto.com/kf/201203/125636.html

06-10 14:27:52.220 16648 16648 W System.err: java.io.FileNotFoundException: /sys/devices/platform/fe8a0000.usb2-phy/otg_mode: open failed: EACCES (Permission denied) 06-10 14:27:52.221 16648 16648 W System.err: at libcore.io.IoBridge.open(IoBridge.java:492) 06-10 14:27:52.221 16648 16648 W System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:236) 06-10 14:27:52.222 16648 16648 W System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:125) 06-10 14:27:52.222 16648 16648 W System.err: at com.kgzn.developer.dialog.CommonToolHolder.switchOTG(CommonToolHolder.java:36) 06-10 14:27:52.222 16648 16648 W System.err: at com.kgzn.developer.dialog.SwitchDialog$16.onClick(SwitchDialog.java:292) 06-10 14:27:52.222 16648 16648 W System.err: at android.view.View.performClick(View.java:7448) 06-10 14:27:52.223 16648 16648 W System.err: at android.widget.CompoundButton.performClick(CompoundButton.java:144) 06-10 14:27:52.223 16648 16648 W System.err: at android.view.View.performClickInternal(View.java:7425) 06-10 14:27:52.223 16648 16648 W System.err: at android.view.View.access$3600(View.java:810) 06-10 14:27:52.223 16648 16648 W System.err: at android.view.View$PerformClick.run(View.java:28305) 06-10 14:27:52.223 16648 16648 W System.err: at android.os.Handler.handleCallback(Handler.java:938) 06-10 14:27:52.224 16648 16648 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99) 06-10 14:27:52.224 16648 16648 W System.err: at android.os.Looper.loop(Looper.java:223) 06-10 14:27:52.224 16648 16648 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7660) 06-10 14:27:52.224 16648 16648 W System.err: at java.lang.reflect.Method.invoke(Native Method) 06-10 14:27:52.225 16648 16648 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 06-10 14:27:52.226 16648 16648 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 06-10 14:27:52.227 16648 16648 W System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) 06-10 14:27:52.227 16648 16648 W System.err: at libcore.io.Linux.open(Native Method) 06-10 14:27:52.227 16648 16648 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:166) 06-10 14:27:52.227 16648 16648 W System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254) 06-10 14:27:52.228 16648 16648 W System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:166) 06-10 14:27:52.228 16648 16648 W System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7546) 06-10 14:27:52.228 16648 16648 W System.err: at libcore.io.IoBridge.open(IoBridge.java:478)
最新发布
06-11
``` 读取CPU使用率失败 java.io.FileNotFoundException: /proc/stat: open failed: EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java:574) at java.io.FileInputStream.<init>(FileInputStream.java:160) at java.io.FileInputStream.<init>(FileInputStream.java:115) at java.io.FileReader.<init>(FileReader.java:60) at com.oem.qisda.CpuInfoService$MyLoadView.readCpuUsage(CpuInfoService.java:248) at com.oem.qisda.CpuInfoService$MyLoadView.lambda$fetchCPULoading$0(CpuInfoService.java:153) at com.oem.qisda.CpuInfoService$MyLoadView.$r8$lambda$SDby1yOKu-DTfFNsl94HJJRwMhE(Unknown Source:0) at com.oem.qisda.CpuInfoService$MyLoadView$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at java.lang.Thread.run(Thread.java:1012) Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:563) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274) at libcore.io.ForwardingOs.open(ForwardingOs.java:563) at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8109) at libcore.io.IoBridge.open(IoBridge.java:560) at java.io.FileInputStream.<init>(FileInputStream.java:160)  at java.io.FileInputStream.<init>(FileInputStream.java:115)  at java.io.FileReader.<init>(FileReader.java:60)  at com.oem.qisda.CpuInfoService$MyLoadView.readCpuUsage(CpuInfoService.java:248)  at com.oem.qisda.CpuInfoService$MyLoadView.lambda$fetchCPULoading$0(CpuInfoService.java:153)  at com.oem.qisda.CpuInfoService$MyLoadView.$r8$lambda$SDby1yOKu-DTfFNsl94HJJRwMhE(Unknown Source:0)  at com.oem.qisda.CpuInfoService$MyLoadView$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)  at java.lang.Thread.run(Thread.java:1012)```需要添加什么权限?
03-15
请检查 以下错误W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Pictures/Screenshots/Screenshot_20230622_152002.jpg: open failed: EACCES (Permission denied) W/System.err: at libcore.io.IoBridge.open(IoBridge.java:575) W/System.err: at java.io.FileInputStream.<init>(FileInputStream.java:160) W/System.err: at okio.Okio__JvmOkioKt.source(JvmOkio.kt:178) W/System.err: at okio.Okio.source(Unknown Source:1) W/System.err: at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo(RequestBody.kt:167) W/System.err: at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.kt:157) W/System.err: at okhttp3.MultipartBody.writeTo(MultipartBody.kt:93) W/System.err: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:59) W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) W/System.err: at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) W/System.err: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517) W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err: at java.lang.Thread.run(Thread.java:930) W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) W/System.err: at libcore.io.Linux.open(Native Method) W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:567) W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:273) W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:567) W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8807) W/System.err: at libcore.io.IoBridge.open(IoBridge.java:561) W/System.err: ... 21 more
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值