'React Native The minCompileSdk (31)) is greater than this module's compileSdkVersion (android-30)

i faced this problem while wants to run project with react-native run-android

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.activity:activity-compose:1.4.0. AAR metadata file: /Users/neda/.gradle/caches/transforms-3/04e923929d67de3c3732020d273dc826/transformed/jetified-activity-compose-1.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.

Thanks for help



Solution 1:[1]

Update the compileSdkVersion to 31 in android/build.gradle (not android/app/build.gradle)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zhen