[android] Version 0.2.4 requires targetSdkVersion = 31
See original GitHub issueDescribe the bug
The latest version of the library (0.2.4) appears to break the build process for RN Android projects due to requiring a higher minCompileSdk than is specified in standard React Native projects.
To Reproduce Steps to reproduce the behavior:
- Create a new React Native project via
npx react-native init - Install the library via
yarn add @stripe/stripe-react-native - Run the android build via
yarn run android - See 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.activity:activity-compose:1.4.0. AAR metadata file: /Users/tom/.gradle/caches/transforms-3/6105d9693b6d1b89f331872365193f55/transformed/jetified-activity-compose-1.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.
Expected behavior The app builds successfully when using the library with fresh RN projects.
Screenshots N/A
Desktop (please complete the following information):
- macOS Monterey 12.1
Smartphone (please complete the following information):
- Android Emulator, any
Additional context N/A
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:29 (3 by maintainers)

Top Related StackOverflow Question
We have the same problem in our project after updating to 0.2.4
Waiting for RN 68 will take forever for Expo users. Is there another option to just waiting?
v0.2.3 can be used in projects that have
compileSdkVersionset to 30v0.17.0 can be used in projects that have
compileSdkVersionset to 31Unfortunately no, since without bumping
compileSdkVersion, you cannot use the latest version ofstripe-android