用户升级HarmonyOS鸿蒙Next系统后,app读取文件失败

用户升级HarmonyOS鸿蒙Next系统后,app读取文件失败 最近这段时间,我们的app用户中突然有很多人反馈说有些功能突然用不了。

经分析,这些用户使用的都是鸿蒙系统,功能异常的原因是文件读取失败。

反馈用户的机型和系统版本:

设备系统版本:10, 设备类型:TEL-AN00a,应用渠道:armv7a-official-huawei_HarmonyOs_TEL-AN00a 2.0.0.2
设备系统版本:12, 设备类型:ELS-AN00,应用渠道:armv7a-official-huawei_HarmonyOs_ELS-AN00 3.0.0.20
设备系统版本:12, 设备类型:OCE-AN50,应用渠道:arm64-huawei-huawei_HarmonyOs_OCE-AN50 3.0.0.202(C
设备系统版本:12, 设备类型:ELS-AN00,应用渠道:armv7a-official-huawei_HarmonyOs_ELS-AN00 3.0.0.20
设备系统版本:12, 设备类型:JER-AN10,应用渠道:arm64-huawei-huawei_HarmonyOs_JER-AN10 3.0.0.202(C
设备系统版本:12, 设备类型:JEF-AN00,应用渠道:arm64-huawei-huawei_HarmonyOs_JEF-AN00 3.0.0.202(C

失败报错:

--------------------- 在 c++ 中使用 fopen 报错 -------------------
尝试加载layout.xml失败,/storage/emulated/0/Android/data/com.ai.marki/files/watermark/11c37c34ba8bb717e9435cef51c8442a/layout.xml, errno=2
尝试加载layout.xml失败,/storage/emulated/0/Android/data/com.ai.marki/files/watermark/a3e427c5a96adf922cb13b33a072627d/layout.xml, errno=2

-------------------- 在 Lua 中调用 io.open 报错 ----------------
Lua_16 LayoutSpecParser.parseInner, can not read file. /storage/emulated/0/Android/data/com.ai.marki/files/watermark/a3e427c5a96adf922cb13b33a072627d/layout.xml

-------------------- 在 Flutter 中报错 ----------------
Logdog FlutterMaint catch error: PathNotFoundException: Cannot open file, path = ‘/data/user/0/com.ai.marki/cache/tmp_zip_de588b8bf7ae10b49fc3457ad45ce434.zip’ (OS Error: No such file or directory, errno = 2)
06:53:45.196 32665-2* I/flutter Logdog FlutterMaint stackTrace: #0 _File.throwIfError (dart:io/file_impl.dart:629)
#1 _File.openSync (dart:io/file_impl.dart:473)
#2 _File.readAsBytesSync (dart:io/file_impl.dart:533)
#3 AssetsUtil.unzipFileTo (package:base_plugin/utils/assets_utils.dart:39)
<asynchronous suspension>
#4 ThemeBaseImageController._copyImageZip (package:base_plugin/theme/image/theme_base_image_controller.dart:41)
<asynchronous suspension>
#5 ThemeBaseImageController.configImageZipInfo (package:base_plugin/theme/image/theme_base_image_controller.dart:26)
<asynchronous suspension>

------------------ 其它报错 ------------------
com.ai.marki: Couldn’t lock the profile file /data/user/0/com.ai.marki/files/iflytek/idata/cache/oat/eeb348ab39a949948421026c619544bd.zip.cur.prof: Failed to open file ‘/data/user/0/com.ai.marki/files/iflytek/idata/cache/oat/eeb348ab39a949948421026c619544bd.zip.cur.prof’: No such file or directory
03-01 07:32:51.959 10030 10055 W com.ai.marki: Could not forcefully load profile /data/user/0/com.ai.marki/files/iflytek/idata/cache/oat/eeb348ab39a949948421026c619544bd.zip.cur.prof

从log看起来都是 "No such file or directory"的错误,但是这些文件都是存在的

请问,鸿蒙系统有没有做过什么这方面的优化和限制,例如锁定文件、限制文件句柄数等


更多关于用户升级HarmonyOS鸿蒙Next系统后,app读取文件失败的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

您好,您的问题需要进一步定位,请您通过在线提单进一步解决:https://developer.huawei.com/consumer/cn/support/feedback/,感谢您的反馈和支持。

更多关于用户升级HarmonyOS鸿蒙Next系统后,app读取文件失败的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


在HarmonyOS鸿蒙Next系统中,app读取文件失败可能是由于系统权限管理机制的变化导致的。鸿蒙Next系统采用了更为严格的权限管理策略,应用在读取文件时需明确请求相应的权限,并且在系统设置中授予访问权限。如果应用未正确配置或请求权限,或者用户在系统设置中未授予相应权限,则可能导致文件读取失败。

此外,鸿蒙Next系统可能引入了新的文件存储路径或访问方式,应用若未适配新的文件访问接口,也可能导致读取失败。开发者需根据鸿蒙Next系统的API文档,更新应用的文件访问逻辑,确保兼容新系统的文件管理机制。

如果应用在升级前能够正常读取文件,而在升级后失败,建议检查应用的权限配置和文件访问代码,确保其符合鸿蒙Next系统的要求。同时,查看系统日志或使用调试工具,定位具体的错误原因,以便进行针对性的修复。

在升级HarmonyOS鸿蒙Next系统后,如果遇到app读取文件失败的问题,可能是由于以下原因:

  1. 权限管理变更:新系统可能加强了权限管理,需要手动授予app访问文件的权限。

  2. 文件路径变动:系统升级可能导致文件存储路径发生变化,app无法找到原路径。

  3. 兼容性问题:部分app可能尚未适配新系统,导致功能异常。

建议检查app权限设置,确保其有读取文件的权限,同时关注app是否有更新版本。

回到顶部