Question

Expo Android Dev Client Build Fails Due to minSdkVersion Conflict with purchases-hybrid-common-ui

  • 17 March 2024
  • 4 replies
  • 128 views

When building an Expo dev client for Android, the build process fails with a Gradle error related to the minSdkVersion required by the com.revenuecat.purchases:purchases-hybrid-common-ui:10.2.0 library. The build process terminates due to a manifest merger failure, indicating that the minSdkVersion of 23 in my project (defined by Expo) cannot be smaller than version 24 declared in the RevenueCat library.

Error Message:

[RUN_GRADLEW] /private/var/folders/xw/4k1kxhpx04303l7nwzy641br0000gn/T/eas-build-local-nodejs/7fdf107e-ffb6-4e98-a686-8cd5dc9436de/build/android/app/src/debug/AndroidManifest.xml Error:
[RUN_GRADLEW] uses-sdk:minSdkVersion 23 cannot be smaller than version 24 declared in library [:react-native-purchases-ui] /private/var/folders/xw/4k1kxhpx04303l7nwzy641br0000gn/T/eas-build-local-nodejs/7fdf107e-ffb6-4e98-a686-8cd5dc9436de/build/node_modules/react-native-purchases-ui/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 23
[RUN_GRADLEW] Suggestion: use a compatible library with a minSdk of at most 23,
[RUN_GRADLEW] or increase this project's minSdk version to at least 24,
[RUN_GRADLEW] or use tools:overrideLibrary="com.revenuecat.purchases.react.ui" to force usage (may lead to runtime failures)
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:processDebugMainManifest'.
[RUN_GRADLEW] > Manifest merger failed : uses-sdk:minSdkVersion 23 cannot be smaller than version 24 declared in library [:react-native-purchases-ui] /private/var/folders/xw/4k1kxhpx04303l7nwzy641br0000gn/T/eas-build-local-nodejs/7fdf107e-ffb6-4e98-a686-8cd5dc9436de/build/node_modules/react-native-purchases-ui/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 23
[RUN_GRADLEW] Suggestion: use a compatible library with a minSdk of at most 23,
[RUN_GRADLEW] or increase this project's minSdk version to at least 24,
[RUN_GRADLEW] or use tools:overrideLibrary="com.revenuecat.purchases.react.ui" to force usage (may lead to runtime failures)

Environment:

  • React Native version: "0.73.5"
  • react-native-purchases version: "^7.24.0"
  • react-native-purchases-ui version: "^7.24.0"
  • Expo version: "^50.0.13"

The build process for iOS Expo dev client completes successfully without any issues.

Could there be something in my configuration causing this issue specifically with Android? I would appreciate any suggestions or tips on how to resolve this.


This post has been closed for comments

4 replies

Userlevel 2
Badge +3

Hi @af6badra,

The `react-native-purchases-ui` library requires a minSdk in android of 24: https://www.revenuecat.com/docs/tools/paywalls#paywalls-are-supported-in-the-following-sdk-versions.

You should be able to update your app’s `build.gradle` file to increase the minSdk version to at least 24, as long as it’s higher than the version required by Expo. 

Let us know if you’re still running into issues!

Thank you @toni-rico!

I managed to update the minSdkVersion in my managed expo app by following the instructions here https://docs.expo.dev/versions/latest/sdk/build-properties/ 

 

I suggest that this article gets updated to include this information.

Userlevel 2
Badge +3

Hi @af6badra,

Glad to hear that you managed to make it work!

As for that article, it indicates how to integrate our base SDK which doesn’t actually require bumping the minSdk version, it’s only needed when using paywalls. So we will consider where to add it so it’s clear moving forward.

Thanks for the feedback!

Thank you @toni-rico!

I managed to update the minSdkVersion in my managed expo app by following the instructions here https://docs.expo.dev/versions/latest/sdk/build-properties/ 

 

I suggest that this article gets updated to include this information.

What did you add to app.json? I have the same error and I can't solve it...