alibaba / AndFix

AndFix is a library that offer hot-fix for Android App.
Other
6.97k stars 1.6k forks source link

.IOException: open failed: ENOENT 缺少权限吗? #330

Open 80678156 opened 7 years ago

80678156 commented 7 years ago

02-19 03:08:42.110: W/AudioTrack(1516): AUDIO_OUTPUT_FLAG_FAST denied by client 02-19 03:08:42.295: W/System.err(3063): java.io.IOException: open failed: ENOENT (No such file or directory) 02-19 03:08:42.296: W/System.err(3063): at java.io.File.createNewFile(File.java:941) 02-19 03:08:42.298: W/System.err(3063): at com.alipay.euler.andfix.util.FileUtil.copyFile(FileUtil.java:49) 02-19 03:08:42.298: W/System.err(3063): at com.alipay.euler.andfix.patch.PatchManager.addPatch(PatchManager.java:162) 02-19 03:08:42.298: W/System.err(3063): at cn.com.chioy.bmdapptest.ui.activity.MainActivity$1.run(MainActivity.java:60) 02-19 03:08:42.298: W/System.err(3063): at java.lang.Thread.run(Thread.java:818) 02-19 03:08:42.298: W/System.err(3063): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) 02-19 03:08:42.299: W/System.err(3063): at libcore.io.Posix.open(Native Method) 02-19 03:08:42.299: W/System.err(3063): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) 02-19 03:08:42.299: W/System.err(3063): at java.io.File.createNewFile(File.java:934) 02-19 03:08:42.299: W/System.err(3063): ... 4 more 02-19 03:08:42.413: W/EGL_emulation(3063): eglSurfaceAttrib not implemented 02-19 03:08:42.413: W/OpenGLRenderer(3063): Failed to set EGL_SWAP_BEHAVIOR on surface 0xae868020, error=EGL_SUCCESS 运行的时候出现上面的问题,已经添加如下权限了 `

`

80678156 commented 7 years ago

貌似是因为com.alipay.euler.andfix.util.FileUtil.copyFile(FileUtil.java:49) copyfile 的时候会拷贝到new File(getFilesDir(), "apatch"); apatch这个目录,但是这个目录并没有创建,代码执行前创建一下就不报错了,不知道是我代码哪里写的出问题了还是因为框架的bug,然而,不报错了,但是修复完好像没有效果。再找找原因,纠结。

80678156 commented 7 years ago

哎,自己写的代码问题,低级错误。测试已经好使了。

rjlatgithub commented 7 years ago

我也遇到这个错了,你是怎么解决的啊?