0

In react native, after adding onesignal package I am getting this error. Can anybody help me about this issue??

Task :app:checkDebugAarMetadata FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings 25 actionable tasks: 5 executed, 20 up-to-date

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.work:work-runtime:2.7.1. AAR metadata file: /Users/user/.gradle/caches/transforms-3/3db9d940a0e1f63c8669f0ed70305a71/transformed/work-runtime-2.7.1/META-INF/com/android/build/gradle/aar-metadata.properties.

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 17s

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 app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.work:work-runtime:2.7.1. AAR metadata file: /Users/user/.gradle/caches/transforms-3/3db9d940a0e1f63c8669f0ed70305a71/transformed/work-runtime-2.7.1/META-INF/com/android/build/gradle/aar-metadata.properties.

  • 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.

  • Get more help at https://help.gradle.org

And my build options like this:

ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "20.1.5948944" }

4
  • change compileSdkVersion and targetSdkVersion to 31 Commented Feb 9, 2022 at 8:32
  • I changed them but it does not work Commented Feb 9, 2022 at 8:36
  • did you properly follow the one signal installation steps? Please go through documentation.onesignal.com/docs/react-native-sdk-setup Commented Feb 9, 2022 at 8:41
  • Are you using managed or bare workflow? Commented Mar 2, 2022 at 22:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.