Skip to content

Commit 103d781

Browse files
authored
fix(android): require minSdk 26 for ML Kit Entity Extraction (#5)
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.
1 parent bec549d commit 103d781

5 files changed

Lines changed: 23 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030

3131
### Fixed
3232

33+
- Corrected the minimum Android SDK to **API 26**. ML Kit Entity Extraction
34+
(`entity-extraction:16.0.0-beta6`) declares `minSdk 26`, so apps at `minSdk 24`
35+
failed to build (manifest merge). The library's declared `minSdkVersion` and the
36+
README requirement are now `26`.
3337
- iOS: return UTF-16 offsets from `NSDataDetector` instead of grapheme-cluster
3438
distances, so `start`/`end` align with JavaScript string indices and Android's
3539
ML Kit char offsets. Previously mismatched on text containing emoji, accented,

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ Each language is a separate ~5.6MB on-device model, downloaded on demand.
213213
## Requirements
214214

215215
- iOS 15.1+
216-
- Android API 24+ (minSdk)
216+
- Android API 26+ (minSdk) — required by ML Kit Entity Extraction. Set
217+
`minSdkVersion = 26` (or higher) in your app; with Expo, use
218+
[`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties/).
217219
- Expo SDK 50+ or bare React Native with `expo-modules-core`
218220

219221
## Contributing

‎android/build.gradle‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ android {
1313
compileSdkVersion safeExtGet("compileSdkVersion", 34)
1414

1515
defaultConfig {
16-
minSdkVersion safeExtGet("minSdkVersion", 24)
16+
// ML Kit Entity Extraction (com.google.mlkit:entity-extraction) requires minSdk 26.
17+
minSdkVersion safeExtGet("minSdkVersion", 26)
1718
targetSdkVersion safeExtGet("targetSdkVersion", 34)
1819
}
1920

‎example/app.json‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
},
2727
"web": {
2828
"favicon": "./assets/favicon.png"
29-
}
29+
},
30+
"plugins": [
31+
[
32+
"expo-build-properties",
33+
{
34+
"android": {
35+
"minSdkVersion": 26
36+
}
37+
}
38+
]
39+
]
3040
}
3141
}

‎example/package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"web": "expo start --web"
1010
},
1111
"dependencies": {
12-
"react-native-data-detector": "file:..",
1312
"expo": "~54.0.33",
13+
"expo-build-properties": "~1.0.10",
1414
"expo-status-bar": "~3.0.9",
1515
"react": "19.1.0",
16-
"react-native": "0.81.5"
16+
"react-native": "0.81.5",
17+
"react-native-data-detector": "file:.."
1718
},
1819
"devDependencies": {
1920
"@types/react": "~19.1.0",

0 commit comments

Comments
 (0)