Skip to content

iOS: File picker cannot be opened #174

Open
@Shunfeii

Description

When i use filepicker on ios it makes error

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWindowScene keyWindow]: unrecognized selector sent to instance 0x109909730'

Here is my code:

val launcher = rememberFilePickerLauncher(mode = PickerMode.Multiple()) { files ->
    // Handle picked files
    if (files != null) {
        println(files.get(0))
    }
}

Box (
    modifier = Modifier.fillMaxSize()
) {
    Column(
        modifier = Modifier.fillMaxSize()
    ) {
        titleBar(
            title = screenModel.deviceName.value,
            native = navigator,
            backgroundColor = Color.White
        )
        Button(
            onClick = {
                launcher.launch()
            }
        ) {
            Text(
                text = "picker"
            )
        }
    }
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions