2

I have updated Flutter New Version 2.5.2 and I got this error.

     *********************************************************
WARNING: This version of video_player will break your Android build if it or its dependencies aren't compatible with AndroidX.
         See https://flutter.dev/docs/development/androidx-migration for more information on the problem and how to fix it.
         This warning prints for all Android build failures. The real root cause of the error may be unrelated.
     *********************************************************


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.0-rc01.
     AAR metadata file: /Users/pratikbutani/.gradle/caches/transforms-2/files-2.1/7d175f0ad1054da40c6bd85adec2789b/work-runtime-2.7.0-rc01/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.

Do let me know if anyone needs more information for this. Any help?

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437

1 Answers1

0
build.gradle:
compileSdkVersion and targetSdkVersion to 30

and

configurations.all {
resolutionStrategy {
force 'androidx.core:core-ktx:1.6.0'
}
}  
Jitendra Mistry
  • 342
  • 1
  • 11
  • Could you share more information about where to place configurations node in build.grade file? To the root? – Utku A. Dec 08 '21 at 14:40