【问题标题】:Multi-Image picker Library Permission issue多图像选择器库权限问题
【发布时间】:2021-05-28 06:25:20
【问题描述】:

使用博览会版本 37..0.12

在尝试加载多张图片时,读取图片时出现权限错误

以下是错误

Permissions.askAsync(Permissions.CAMERA,Permissions.CAMERA_ROLL, Permissions.READ_EXTERNAL_STORAGE);
Error: [Unhandled promise rejection: Error: Failed to get permissions]

在 Android 中使用多图像选择器库时会发生这种情况:“expo-image-picker-multiple”:“1.4.0”

【问题讨论】:

    标签: android permissions expo


    【解决方案1】:

    我假设您已经在清单中使用了此权限

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />.

    如果是,可能是因为您在项目中没有这样的运行时权限

    val requestPermissionLauncher =
        registerForActivityResult(RequestPermission()
        ) { isGranted: Boolean ->
            if (isGranted) {
                // Permission is granted. Continue the action or workflow in your
                // app.
            } else {
                // Explain to the user that the feature is unavailable because the
                // features requires a permission that the user has denied. At the
                // same time, respect the user's decision. Don't link to system
                // settings in an effort to convince the user to change their
                // decision.
            }
        }
    

    Ref: Android Docs for Runtime Permission

    【讨论】:

      猜你喜欢
      • 2021-12-25
      • 1970-01-01
      • 1970-01-01
      • 2012-12-28
      • 1970-01-01
      • 1970-01-01
      • 2021-01-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多