@dr33m/react-native-litert-lm 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/app.plugin.js +20 -1
  2. package/package.json +1 -1
package/app.plugin.js CHANGED
@@ -2,10 +2,11 @@
2
2
  * Expo config plugin for react-native-litert-lm.
3
3
  *
4
4
  * Ensures correct build settings for the LiteRT-LM native module:
5
- * - Android: minSdkVersion 26
5
+ * - Android: minSdkVersion 26, Kotlin 2.3.0 (required by litertlm-android AAR)
6
6
  */
7
7
  const {
8
8
  withGradleProperties,
9
+ withProjectBuildGradle,
9
10
  } = require('@expo/config-plugins');
10
11
 
11
12
  function withLiteRTLM(config) {
@@ -28,6 +29,24 @@ function withLiteRTLM(config) {
28
29
  return config;
29
30
  });
30
31
 
32
+ // Android: Pin Kotlin Gradle plugin to 2.3.0
33
+ // The litertlm-android AAR uses Kotlin 2.3.0 metadata which cannot be read
34
+ // by older compilers. This forces the project-level Kotlin plugin to 2.3.0.
35
+ config = withProjectBuildGradle(config, (config) => {
36
+ if (config.modResults.language === 'groovy') {
37
+ const contents = config.modResults.contents;
38
+
39
+ if (!contents.includes("kotlin-gradle-plugin:2.3.0")) {
40
+ config.modResults.contents = contents.replace(
41
+ "classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')",
42
+ "classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0')"
43
+ );
44
+ }
45
+ }
46
+
47
+ return config;
48
+ });
49
+
31
50
  return config;
32
51
  }
33
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dr33m/react-native-litert-lm",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "litertLm": {
5
5
  "version": "0.12.0",
6
6
  "androidMavenVersion": "0.12.0",