> Task :app:checkReleaseAarMetadata FAILED - React native - react-native

I am making a release build for my project using ./gradlew assembleRelease command but it gives me this error.
> Task :app:checkReleaseAarMetadata FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
> Could not resolve com.facebook.android:facebook-android-sdk:[8,9).
Required by:
project :app
> Failed to list versions for com.facebook.android:facebook-android-sdk.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
my build.gradle
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
googlePlayServicesAuthVersion = "16.0.1"
}

To solve this issue just change the compileSdkVersion in your build.gradle file.
Open android > build.gradle file.
Change compileSdkVersion from 29 to 30.
Change targetSdkVersion from 29 to 30.
now run again.

To solve this issue just add mavenCentral() in repositories of your project build.gradle.
Refer to https://developers.facebook.com/docs/android/getting-started/

Related

Getting an error with react-native-safe-area-context build.gradle file and compileSdkVersion is not specified

I am getting this Error message while building my react native project.
BUILD FAILED in 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\sawan\OneDrive\Desktop\Unsplash\app\node_modules\react-native-safe-area-context\android\build.gradle' line: 28
* What went wrong:
A problem occurred evaluating project ':react-native-safe-area-context'.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-safe-area-context'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
Its saying error is in this file:
C:\Users\sawan\OneDrive\Desktop\Unsplash\app\node_modules\react-native-safe-area-context\android\build.gradle
//rest of the code ...
android {
compileSdkVersion getExtOrDefault('compileSdkVersion', 30)
// Used to override the NDK path/version on internal CI or by allowing
// users to customize the NDK path/version from their root project (e.g. for M1 support)
if (rootProject.hasProperty("ndkPath")) {
ndkPath rootProject.ext.ndkPath
}
if (rootProject.hasProperty("ndkVersion")) {
ndkVersion rootProject.ext.ndkVersion
}
defaultConfig {
minSdkVersion getExtOrDefault('minSdkVersion', 16)
targetSdkVersion getExtOrDefault('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
ndk {
abiFilters (*reactNativeArchitectures())
}
}// rest of the code ....
Here is my build.gradle file from \android
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
// kotlin_version = '1.5.20' //
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.facebook.react:react-native-gradle-plugin")
// classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") //
}}
Don't know if error is in this path or the build.gradle file

React Naitve Android error compileSdkVersion is not specified. Please add it to build.gradle

I am having build error
What went wrong:
A problem occurred configuring project ':app'.
compileSdkVersion is not specified. Please add it to build.gradle
build.gradle
googlePlayServicesVersion = "+"
firebaseMessagingVersion = "21.1.0"
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
app/build.gradle
compileSdkVersion rootProject.ext.compileSdkVersion
Ia m using React Native version 0.63.4 and gradle version 7
How do I fix this?
I tried online solutions nothing worked

Issue with React Native - Async Storage

I'm trying to run my react-native app but suddenly receiving the following error:
Task :react-native-community_async-storage:compileDebugJavaWithJavac FAILED
* What went wrong:
Execution failed for task ':react-native-community_async-storage:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
My project was fine till Friday (05th November). I am getting this from today morning.
"#react-native-community/async-storage": "^1.7.1",
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

Execution failed for task ':react-native-agora:compileDebugJavaWithJavac'

i have tried npx react-native start run android
i got this Execution failed for task.and i remove node module and lock file than reinstall(npm) same error.and also i removed agora file after i add npm i react-native-agora. that time same compileDebugJavaWithJavac with different dependencies(example react-native-image-crop-picker:compileDebugJavaWithJavac ) than i try same way to remove and add npm i got another error(react-native-agora:compileDebugJavaWithJavac)
error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-agora:compileDebugJavaWithJavac'.
> Failed to query the value of task ':react-native-agora:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /home/ubuntu/Desktop/quaquiz/node_modules/react-native-agora/android/build/generated/ap_generated_sources/debug/out))) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#49f0db11) before task ':react-native-agora:compileDebugJavaWithJavac' has completed is not supported
build gradle:
uildscript {
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "17.0.0"
}
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.1')
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
here i increased sdk version 30 after i got all this error.
before i using build gradle
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
See if this help
cd android && ./gradlew clean && cd ..
Probability, it's gradle incompatible. set gradle in dependencies to
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2')
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

React Native Execution failed for task ':app:processDebugResources'

This problem has been stated When I add firebase
This problem happen when react-native run-android
I tried to ./grandlew clean and all solitons but still continues.
classpath 'com.android.tools.build:gradle:3.0.1'
buildToolsVersion = "26.0.3"
minSdkVersion = 16
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.1.0"
Full Error;
Execution failed for task ':app:processDebugResources'.
Failed to execute aapt