Build error with RN 0.69.2 - minSdk version conflict
See original GitHub issueHello!
I have an issue with building the app in Azure Pipelines after upgrading to react-native 0.69.2 (using old architecture, not new), It was building and working fine with 0.67.4.
Build error says there’s a conflict between minSdkVersion of the library and react-native version:
* What went wrong:
Execution failed for task ':react-native-sqlite-2:processDebugAndroidTestManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.69.2] /Users/runner/.gradle/caches/transforms-3/1ecf169629d825591b5487eeb6e62473/transformed/jetified-react-native-0.69.2-debug/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
Main minSdkVersion in my build.gradle is set to 21, same as react-native library. Bur your build.gradle says 16. There should not be an error though, because it will be overriden by manifest merge. But there is… My assumption it’s because of the nesting dependency of react-native inside your build.gradle.
dependencies {
implementation 'com.facebook.react:react-native:+'
api 'androidx.sqlite:sqlite:2.1.0'
implementation 'com.github.requery:sqlite-android:3.36.0'
}
So the build process checks this hierarchy first, and find a conflict between your library and dependency. You define minSdk as 16, but maybe it’s possible to use the one from the main project? As you do with target sdk?
defaultConfig {
minSdkVersion 16
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.6.2"
}
I’ve tried to override library use-sdk from manifest, but no luck. Probably because it’s a nested dependency conflict that is checked before overriding from main manifest.
Same issue was with other library, and it was fixed by using same approach as for targetSdkVersion
Issue Analytics
- State:
- Created a year ago
- Comments:13 (6 by maintainers)
v3.6.0 has landed. Thanks for the report.
thank you!