afkT/DevUtils

发现demo在使用DevEnvironment过程中会出现如下问题 ,华为8.10 10.0.0 都有这个报错信息

chenyang1900 opened this issue · 1 comments

在使用DevEnvironment ,发现demo再使用过程中会出现如下问题 ,华为8.10 10.0.0 都有这个报错信息 ,权限都已获取到;

java.io.FileNotFoundException: /data/user/0/afkt.project/cache/DevEnvironment/MODULE_MAP: open failed: ENOENT (No such file or directory)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at libcore.io.IoBridge.open(IoBridge.java:496)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at java.io.FileInputStream.(FileInputStream.java:159)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at dev.environment.DevEnvironment.readStorage(DevEnvironment.java:588)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at dev.environment.DevEnvironment.getMapEnvironment(DevEnvironment.java:395)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at dev.environment.Utils.getModuleEnvironment(Utils.java:116)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at dev.environment.AdapterItem.refreshHashCode(AdapterItem.java:75)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at dev.environment.DevEnvironmentActivity.onCreate(DevEnvironmentActivity.java:94)
2020-11-24 19:24:28.620 26996-26996/afkt.project W/System.err: at android.app.Activity.performCreate(Activity.java:8066)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.Activity.performCreate(Activity.java:8054)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3733)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3939)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2373)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.os.Looper.loop(Looper.java:213)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8147)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at libcore.io.Linux.open(Native Method)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8015)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: at libcore.io.IoBridge.open(IoBridge.java:482)
2020-11-24 19:24:28.621 26996-26996/afkt.project W/System.err: ... 22 more

afkT commented

这个问题我这几天发个版本,在最新版本内修复

这个不是权限问题,在 应用内部存储读写文件,不需要权限的

这个是上一个问题说的一个存储文件问题

当你选中某个环境时会存储一个 MODULE_NAME => MODULE_MAP 文件 ( 无后缀,JSON 格式 )

/data/user/0/afkt.project/cache/DevEnvironment/MODULE_MAP

你看存储的路径就是这样,然后可能出现部分 ROM 认为这是一个文件夹路径,而非文件

我在最新版统一加上 .json 后缀,则不会出现该情况了