onseok / peekaboo

🌄 Kotlin Multiplatform library for Compose Multiplatform, designed for seamless integration of an image picker feature in iOS and Android applications.
Apache License 2.0
206 stars 18 forks source link

Issue #64

Open kwesiamartey opened 7 months ago

kwesiamartey commented 7 months ago

this doesn't work on android 11 and above

Doesn't work on all devices

l2hyunwoo commented 6 months ago

Hello, @kwesiamartey can you provide error logs in here?

jiangkaifang commented 5 months ago

Hello, I am a developer from China. I can only use Google Translate to communicate with you. I am very sorry for this. I seem to have encountered this problem too. I currently only have two devices in my hand, one is Android 9 and the other is Android 13. On Android 9, I can successfully wake up the permission application and open the camera smoothly, but my other Android 13 has no response and no error prompts. I'm not sure if this is a problem I'm using

petrchatrny commented 3 months ago

Hello there, I encountered same problem. I think the issue here is due to permission handling - when I manually enable Camera permission in application settings, everything works fine.

Without manual grant of Camera permission for the application, the code below just prints a message to the console and no camera view is displayed, nor is the user prompted to grant the permission.

Tested on: Emulator with Android API 34 Code:


@Composable
@Preview
fun App() {
    MaterialTheme {
        Column(modifier = Modifier.fillMaxSize()) {
            Text("Some text")
            MyScreen()
        }
    }
}

@Composable
fun MyScreen() {
    val state = rememberPeekabooCameraState(
        onCapture = { /* Handle captured images */ },
    )

    PeekabooCamera(
        state = state,
        modifier = Modifier.fillMaxSize(),
        permissionDeniedContent = {
            println("\uD83C\uDF44 Permission failed")
        },
    )
}

Logs:


2024-05-30 16:45:07.619  8330-8330  ziparchive              cz.procyon.kmp                       W  Unable to open '/data/app/~~SDxJRZhIeCcJD6Dyhkuf0Q==/cz.procyon.kmp-d8jdsrz5V2CUvCgPptHrYw==/base.dm': No such file or directory
2024-05-30 16:45:07.619  8330-8330  ziparchive              cz.procyon.kmp                       W  Unable to open '/data/app/~~SDxJRZhIeCcJD6Dyhkuf0Q==/cz.procyon.kmp-d8jdsrz5V2CUvCgPptHrYw==/base.dm': No such file or directory
2024-05-30 16:45:08.160  8330-8330  nativeloader            cz.procyon.kmp                       D  Configuring clns-6 for other apk /data/app/~~SDxJRZhIeCcJD6Dyhkuf0Q==/cz.procyon.kmp-d8jdsrz5V2CUvCgPptHrYw==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~SDxJRZhIeCcJD6Dyhkuf0Q==/cz.procyon.kmp-d8jdsrz5V2CUvCgPptHrYw==/lib/x86_64:/data/app/~~SDxJRZhIeCcJD6Dyhkuf0Q==/cz.procyon.kmp-d8jdsrz5V2CUvCgPptHrYw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/cz.procyon.kmp
2024-05-30 16:45:08.182  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V  Currently set values for:
2024-05-30 16:45:08.182  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V    angle_gl_driver_selection_pkgs=[]
2024-05-30 16:45:08.182  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V    angle_gl_driver_selection_values=[]
2024-05-30 16:45:08.186  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V  ANGLE GameManagerService for cz.procyon.kmp: false
2024-05-30 16:45:08.186  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V  cz.procyon.kmp is not listed in per-application setting
2024-05-30 16:45:08.186  8330-8330  GraphicsEnvironment     cz.procyon.kmp                       V  Neither updatable production driver nor prerelease driver is supported.
2024-05-30 16:45:08.233  8330-8351  libEGL                  cz.procyon.kmp                       D  loaded /vendor/lib64/egl/libEGL_emulation.so
2024-05-30 16:45:08.236  8330-8351  libEGL                  cz.procyon.kmp                       D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2024-05-30 16:45:08.247  8330-8351  libEGL                  cz.procyon.kmp                       D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2024-05-30 16:45:08.333  8330-8330  Compatibil...geReporter cz.procyon.kmp                       D  Compat change id reported: 237531167; UID 10187; state: DISABLED
2024-05-30 16:45:08.343  8330-8330  OpenGLRenderer          cz.procyon.kmp                       W  Unknown dataspace 0
2024-05-30 16:45:08.658  8330-8330  System.out              cz.procyon.kmp                       I  🍄 Permission failed
2024-05-30 16:45:08.766  8330-8349  OpenGLRenderer          cz.procyon.kmp                       W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
2024-05-30 16:45:08.795  8330-8349  Gralloc4                cz.procyon.kmp                       I  mapper 4.x is not supported
2024-05-30 16:45:09.248  8330-8345  OpenGLRenderer          cz.procyon.kmp                       I  Davey! duration=982ms; Flags=1, FrameTimelineVsyncId=96529, IntendedVsync=5686048911655, Vsync=5686165578317, InputEventId=0, HandleInputStart=5686177177359, AnimationStart=5686177183710, PerformTraversalsStart=5686178370408, DrawStart=5686667056478, FrameDeadline=5686065578321, FrameInterval=5686173312767, FrameStartTime=16666666, SyncQueued=5686676904907, SyncStart=5686682970359, IssueDrawCommandsStart=5686683708793, SwapBuffers=5686859062983, FrameCompleted=5687037730169, DequeueBufferDuration=3487, QueueBufferDuration=757463, GpuCompleted=5686859062983, SwapBuffersCompleted=5687037730169, DisplayPresentTime=0, CommandSubmissionCompleted=5686859062983, 
2024-05-30 16:45:09.257  8330-8330  Choreographer           cz.procyon.kmp                       I  Skipped 49 frames!  The application may be doing too much work on its main thread.
2024-05-30 16:45:13.410  8330-8360  ProfileInstaller        cz.procyon.kmp                       D  Installing profile for cz.procyon.kmp