From c09f5dc817f69b7e527139df45bdf53750ef90e7 Mon Sep 17 00:00:00 2001 From: Pablo Giraud-Carrier Date: Fri, 5 Jun 2026 18:41:55 +0200 Subject: [PATCH] fix(android): require minSdk 26 for ML Kit Entity Extraction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit com.google.mlkit:entity-extraction:16.0.0-beta6 declares minSdk 26, so any app at minSdk 24 fails the Android manifest merge — the library was never installable at its documented floor of 24. Bump the declared minSdkVersion fallback to 26 and update the README requirement. Also configure the example app to build at minSdk 26 via expo-build-properties. --- CHANGELOG.md | 4 ++++ README.md | 4 +++- android/build.gradle | 3 ++- example/app.json | 12 +++++++++++- example/package.json | 5 +++-- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 158ff87..c0f1741 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Corrected the minimum Android SDK to **API 26**. ML Kit Entity Extraction + (`entity-extraction:16.0.0-beta6`) declares `minSdk 26`, so apps at `minSdk 24` + failed to build (manifest merge). The library's declared `minSdkVersion` and the + README requirement are now `26`. - iOS: return UTF-16 offsets from `NSDataDetector` instead of grapheme-cluster distances, so `start`/`end` align with JavaScript string indices and Android's ML Kit char offsets. Previously mismatched on text containing emoji, accented, diff --git a/README.md b/README.md index ea1d613..5f2a66a 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,9 @@ Detects entities in the given text using native platform APIs. ## Requirements - iOS 15.1+ -- Android API 24+ (minSdk) +- Android API 26+ (minSdk) — required by ML Kit Entity Extraction. Set + `minSdkVersion = 26` (or higher) in your app; with Expo, use + [`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties/). - Expo SDK 50+ or bare React Native with `expo-modules-core` ## Contributing diff --git a/android/build.gradle b/android/build.gradle index b047d7f..8491832 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -13,7 +13,8 @@ android { compileSdkVersion safeExtGet("compileSdkVersion", 34) defaultConfig { - minSdkVersion safeExtGet("minSdkVersion", 24) + // ML Kit Entity Extraction (com.google.mlkit:entity-extraction) requires minSdk 26. + minSdkVersion safeExtGet("minSdkVersion", 26) targetSdkVersion safeExtGet("targetSdkVersion", 34) } diff --git a/example/app.json b/example/app.json index 16b31b1..79e3c7e 100644 --- a/example/app.json +++ b/example/app.json @@ -26,6 +26,16 @@ }, "web": { "favicon": "./assets/favicon.png" - } + }, + "plugins": [ + [ + "expo-build-properties", + { + "android": { + "minSdkVersion": 26 + } + } + ] + ] } } diff --git a/example/package.json b/example/package.json index ef3dcc2..840faa2 100644 --- a/example/package.json +++ b/example/package.json @@ -9,11 +9,12 @@ "web": "expo start --web" }, "dependencies": { - "react-native-data-detector": "file:..", "expo": "~54.0.33", + "expo-build-properties": "~1.0.10", "expo-status-bar": "~3.0.9", "react": "19.1.0", - "react-native": "0.81.5" + "react-native": "0.81.5", + "react-native-data-detector": "file:.." }, "devDependencies": { "@types/react": "~19.1.0",