Skip to content

在 composeApp/src/commonMain/composeResources/drawable 下新增图片或者重命名已有图片,编译通过后在鸿蒙上跑会崩溃 #28

Description

@Jadyli

举个例子,把 composeApp/src/commonMain/composeResources/drawable/dialog.png 改名为 dialog_1.png,引用的地方相应改为 Res.drawable.dialog_1,执行 publishDebugBinariesToHarmonyApp,在鸿蒙项目里跑起来后,会报错 ArrayIndexOutOfBoundException,我 debug 之后发现是在鸿蒙里读不到这个文件,对应的项目代码是:

Image

这里拿出来 size 为 0,rawFile 是一串 0。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions