Am getting following error while building apk through gradlew assembleRelease
**Error :**
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
8 issues were found when checking AAR metadata:
Dependency 'androidx.appcompat:appcompat:1.4.1' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.appcompat:appcompat-resources:1.4.1' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.emoji2:emoji2-views-helper:1.0.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.emoji2:emoji2:1.0.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.lifecycle:lifecycle-process:2.4.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.tracing:tracing:1.1.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.core:core:1.7.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.lifecycle:lifecycle-runtime:2.4.0' requires libraries and applications that
depend on it to compile against version 31 or later of the
Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion
of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
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:
java.lang.StackOverflowError (no error message)
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 1.17 GB / 15.69 GB
Binaries:
Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 27, 29, 31, 32, 33
Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0, 33.0.1
System Images: android-31 | Google APIs Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-213.7172.25.2113.9123335
Visual Studio: Not Found
Languages:
Java: 11.0.17 - C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.1 => 0.71.1
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong: Execution failed for task ':app:checkReleaseAarMetadata'.
Dependency 'androidx.appcompat:appcompat:1.4.1' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.appcompat:appcompat-resources:1.4.1' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.emoji2:emoji2-views-helper:1.0.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.emoji2:emoji2:1.0.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.lifecycle:lifecycle-process:2.4.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.tracing:tracing:1.1.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.core:core:1.7.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Dependency 'androidx.lifecycle:lifecycle-runtime:2.4.0' requires libraries and applications that depend on it to compile against version 31 or later of the Android APIs.
:app is currently compiled against android-27.
Recommended action: Update this project to use a newer compileSdkVersion of at least 31, for example 33.
Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
Try:
2: Task failed with an exception.
info Fetching system and libraries information... System: OS: Windows 10 10.0.22621 CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz Memory: 1.17 GB / 15.69 GB Binaries: Node: 18.12.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 27, 29, 31, 32, 33 Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0, 33.0.1 System Images: android-31 | Google APIs Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64 Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-213.7172.25.2113.9123335 Visual Studio: Not Found Languages: Java: 11.0.17 - C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.1 => 0.71.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found