I am trying to add google_mobile_ads, version 1.0.0 by following the steps mentioned in this answer: https://stackoverflow.com/a/67883550/13240914, but when I run the app in debug mode, I get this error:
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.
AAR metadata file: /Users/mydata/.gradle/caches/transforms-2/files-2.1/6ca6bfbb6ed79157a08fdd6548cc9e4d/work-runtime-2.7.0/META-INF/com/android/build/gradle/aar-metadata.properties.
Is there any way to solve this problem? and here is android/app/build.gradle https://gist.github.com/wahyu-handayani/025cbb7c538196cf91e6629ac668954f