question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error with RN 0.69.2 - minSdk version conflict

See original GitHub issue

Hello!

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:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
craftzdogcommented, Aug 11, 2022

v3.6.0 has landed. Thanks for the report.

0reactions
Ruslan-Mzcommented, Aug 11, 2022

thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ ] Android build fail due to minSdkVersion conflict · Issue #1560
Description After install this package, I got build error on Android Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 21 ...
Read more >
Struggling to get Android build working due to minSdkVersion
The issue is that RN 0.64 increased its minSdkVersion from 16 to 21. Many RN libraries have minSdkVersion hard-coded at 16, which is...
Read more >
configure project :react-native-reanimated aar for ... - You.com
I am facing issue while runnning app and creating builds "Task :app:mergeDebugAssets FAILED" ... minSdkVersion targetSdkVersion rootProject.ext.
Read more >
"React Native version mismatch" errors - Expo Documentation
This can happen after upgrading your React Native or Expo SDK version, or when connecting to the wrong local development server.
Read more >
react-native-sqlite-2 - Bountysource
Build error says there's a conflict between minSdkVersion of the library and react-native version: * What went wrong: Execution failed for task ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found