Error running app :@react-native-community_art:checkDebugManifest FAILED

Viewed 17

I need to update a project that uses react-native, first I needed to update the SDK version and everything went well. But I also need to update my project's gradle version which currently uses version 6.5, when trying to update to version 7.2 I get the following error:

Task :@react-native-community_art:checkDebugManifest FAILED

buid.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 31
        targetSdkVersion = 31
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'com.google.gms:google-services:4.3.2'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
        classpath 'com.google.firebase:perf-plugin:1.3.1'
    }
}

allprojects {
    repositories {
        maven { url "https://www.jitpack.io" }
        mavenLocal()
        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")
        }
       
        google()
        jcenter()
    }
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

gradle.properties

org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8    
android.useAndroidX=true
android.enableJetifier=true

MYAPP_RELEASE_STORE_FILE=debug.keystore
MYAPP_RELEASE_KEY_ALIAS=androiddebugkey
MYAPP_RELEASE_STORE_PASSWORD=xxxxx
MYAPP_RELEASE_KEY_PASSWORD=xxxxx

I'm new to react-native so thanks in advance for any help as I've been stuck on this issue for a few hours.

1 Answers
buildscript {
 ext {
  buildToolsVersion = "30.0.3"
  minSdkVersion = 21 // <--now use this
  compileSdkVersion = 31
  targetSdkVersion = 31
 }
}

and in your android manifest add android:exported="true" to the \android\app\src\main\AndroidManifest.xml files activity section. For example:

<activity android:name=".MainActivity" android:exported="true"> // <- add it here. ! . ! <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

and just after that:

cd .\android\
./gradlew clean

Because you're using Gradle 7 maven is removed and you need to replace it So, instead of using:

apply plugin: 'maven'

you should use

apply plugin: 'maven-publish'

Related