首页 > 解决方案 > 打开相机的权限被拒绝 - SDK29 - React Native Project

问题描述

将SDK改成29后,原来在28上正常打开的摄像头现在被拒绝权限了。

我的项目是在“react-native”中开发的:“0.59.9”。

以下是一些附加信息:

构建.gradle

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 19
        compileSdkVersion = 29
        targetSdkVersion = 29
        supportLibVersion = "28.0.0"
        googlePlayServicesAuthVersion = "15.0.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.2.0'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()

        // ADD THIS
        maven { url 'https://maven.google.com' }

        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        
        
        // ADD THIS
        maven { url "https://jitpack.io" }
    }
}


wrapper{
    gradleVersion = '4.7'
    distributionUrl = distributionUrl.replace("bin", "all")
}

在此处输入图像描述

警告:

在此处输入图像描述

我向正在阅读的任何人指出,我遵循了这篇文章https://www.reactnativeschool.com/how-to-upgrade-react-native-app-to-api-level-29的指导方针,但是,在过程 我遇到了相机问题。

有没有人遇到过这样的问题?他们会知道如何指导我如何进行吗?

标签: androidreact-native

解决方案


推荐阅读