Permission to open camera denied - SDK29 - React Native Project - android

After changing the SDK to 29, the camera that used to open normally on 28 is now denied permission.
My project is developed in "react-native": "0.59.9".
Here is some additional information:
build.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")
}
warning:
I point out to anyone who is reading that I followed the guidelines of this article https://www.reactnativeschool.com/how-to-upgrade-react-native-app-to-api-level-29, however, after the procedure I am facing the problem with the camera.
Has anyone faced a problem like this? Would they know how to guide me how to proceed?

Related

Task :app:processDebugMainManifest FAILED error react-native on running the project

I am getting this error after installing react-native-push-notification package.
here is my android.manifest file
`
I have tried changing the package version as well other results on internet but it won't work for me.
here is my build.gradle file:
`
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath 'com.google.gms:google-services:4.3.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}
`

Android Studio: No build variant found for ':expo'. error

I Encountered a error saying No variants found for ':expo'. Check build files to ensure at least one variant exists.
I Already download all the SDK's Clear the Project multi times but nothing work
Here is the build.gradle code
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
supportLibVersion = "29.0.0"
}
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath('com.android.tools.build:gradle:4.2.2')
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.huawei.agconnect:agcp:1.4.2.301'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
maven { url 'https://developer.huawei.com/repo/' }
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. Could not find ::

I got this error when im trying to run my react native app on Android emulator.
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find ::.
Required by:
project :app
My build.gradle
import org.apache.tools.ant.taskdefs.condition.Os
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
googlePlayServicesVersion = "9.8.0"
firebaseMessagingVersion = '21.1.0'
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath ('com.google.gms:google-services:4.3.3')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {url 'https://jcenter.bintray.com'}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}

Could not GET 'https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml'. Received code 502: Bad Gateway

I've been having this issue since about 9 Dec. It seems jcenter has sunset 2 months early (https://status.bintray.com/)
I've updated my RN version to 0.65.0, my Gradle to v6.9 and I've added mavenCentral() in place of jcenter(). Building in offline mode does not work and is not a permanent solution.
This happens during build cd android && ./gradlew clean && ./gradlew bundleRelease
Full error:
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/flexbox-layout/com/facebook/react/react-native/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
root level build.gradle:
buildscript {
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
kotlinVersion = "1.3.72"
supportLibVersion = "30.0.0"
supportVersion = "30.0.0"
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath ("com.android.tools.build:gradle:4.1.2")
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven {
// react-native-date-picker
url "https://www.jitpack.io"
}
maven { url "https://maven.google.com" }
}
}

When i installed and link react-native-admob in project application got crash on load time

I am facing problem in react-native before install react-native-admob my app was working fine but after installed and linked by this library my app getting crash on loading time.
I installed latest version of react-native-admob (react-native-admob#next)
react native version: 0.57.8
react version: 16.6.3
Testing on Android oreo
android/build.gradle code
// Top-level build file where you can add configuration options
common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
Please help me.
If you want anythings for clarification i will provide.
Goto
node-module/react-native-admob/android/build.gradle file
replace the line
compile 'com.google.android.gms:play-services-ads:+'
with the following line
compile 'com.google.android.gms:play-services-ads:16.0.0'

Categories

Resources