You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I copied the sample code from the README and implemented it in my Compose Multiplatform project. While the code runs smoothly on iOS, it causes the Android app to crash at runtime.
Version:
dev.icerock.moko:permissions-compose:0.18.1
Code snippet:
@Composable
fun Sample() {
val factory: PermissionsControllerFactory = rememberPermissionsControllerFactory()
val controller: PermissionsController = remember(factory) { factory.createPermissionsController() }
val coroutineScope: CoroutineScope = rememberCoroutineScope()
Button(
onClick = {
coroutineScope.launch {
controller.providePermission(Permission.RECORD_AUDIO)
}
}
) {
Text(text = "give permissions")
}
}
Steps to reproduce:
Copy the above sample code.
Add the code to a Compose Multiplatform project.
Run the app on an Android device.
Click on the button.
Expected behavior:
The sample code should work as intended on both iOS and Android without issues.
Actual behavior:
iOS: The app runs as expected.
Android: The app crashes at runtime.
Error log:
java.lang.IllegalStateException: activityResultLauncher is null, `bind` function was never called, consider calling permissionsController.bind(activity) or BindEffect(permissionsController) in the composable function, check the documentation for more info: https://github.com/icerockdev/moko-permissions/blob/master/README.md
at dev.icerock.moko.permissions.PermissionsControllerImpl.awaitActivityResultLauncher(PermissionsControllerImpl.kt:129)
at dev.icerock.moko.permissions.PermissionsControllerImpl.access$awaitActivityResultLauncher(PermissionsControllerImpl.kt:34)
Please let me know if additional logs or information are needed to help resolve this issue.
The text was updated successfully, but these errors were encountered:
Hi folks,
I copied the sample code from the README and implemented it in my Compose Multiplatform project. While the code runs smoothly on iOS, it causes the Android app to crash at runtime.
Version:
Code snippet:
Steps to reproduce:
Expected behavior:
The sample code should work as intended on both iOS and Android without issues.
Actual behavior:
iOS: The app runs as expected.
Android: The app crashes at runtime.
Error log:
Please let me know if additional logs or information are needed to help resolve this issue.
The text was updated successfully, but these errors were encountered: