@sellwild/react-native-sdk 1.3.6 → 1.3.7
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.
- package/README.md +21 -0
- package/android/build.gradle +31 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,27 @@ npm install @sellwild/react-native-sdk react-native-webview
|
|
|
9
9
|
cd ios && pod install && cd ..
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
### Android: Kotlin stdlib fix (RN 0.74)
|
|
13
|
+
|
|
14
|
+
If your Android build fails with "incompatible version of Kotlin" errors, add this to your `android/build.gradle`:
|
|
15
|
+
|
|
16
|
+
```groovy
|
|
17
|
+
subprojects {
|
|
18
|
+
afterEvaluate {
|
|
19
|
+
configurations.all {
|
|
20
|
+
resolutionStrategy {
|
|
21
|
+
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
|
22
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
|
|
23
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
|
|
24
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This forces transitive dependencies (Prebid Mobile, GMA) to use your app's Kotlin version instead of pulling in incompatible newer versions.
|
|
32
|
+
|
|
12
33
|
## Quick Start
|
|
13
34
|
|
|
14
35
|
```tsx
|
package/android/build.gradle
CHANGED
|
@@ -16,7 +16,13 @@ buildscript {
|
|
|
16
16
|
|
|
17
17
|
dependencies {
|
|
18
18
|
classpath "com.android.tools.build:gradle:8.7.3"
|
|
19
|
-
|
|
19
|
+
// Default to Kotlin 1.9.22 — matches RN 0.74's bundled toolchain.
|
|
20
|
+
// Host apps that pin a newer Kotlin via `ext.kotlinVersion` in their
|
|
21
|
+
// root build.gradle override this. We intentionally do NOT default
|
|
22
|
+
// to 2.1.x here: when the host's compiler is 1.9 (RN 0.74 default),
|
|
23
|
+
// a 2.1 stdlib on the classpath causes "incompatible metadata"
|
|
24
|
+
// errors compiling these bridge sources.
|
|
25
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion', '1.9.22')}"
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -43,6 +49,12 @@ android {
|
|
|
43
49
|
|
|
44
50
|
kotlinOptions {
|
|
45
51
|
jvmTarget = "17"
|
|
52
|
+
// Pin to 1.9 so the bridge sources are always compilable by the
|
|
53
|
+
// host's Kotlin compiler. Bridge code uses only 1.9-compatible
|
|
54
|
+
// idioms (no data objects, no context receivers, no 2.0-only
|
|
55
|
+
// language features). Verified safe.
|
|
56
|
+
apiVersion = "1.9"
|
|
57
|
+
languageVersion = "1.9"
|
|
46
58
|
}
|
|
47
59
|
}
|
|
48
60
|
|
|
@@ -66,3 +78,21 @@ dependencies {
|
|
|
66
78
|
// for npm consumers, or to mavenLocal in the SDK monorepo dev workflow.
|
|
67
79
|
implementation "com.sellwild:sdk:1.3.5"
|
|
68
80
|
}
|
|
81
|
+
|
|
82
|
+
// Force kotlin-stdlib down to the bridge's declared Kotlin version. The
|
|
83
|
+
// SDK AAR (com.sellwild:sdk) is compiled with Kotlin 2.1.20 and its POM
|
|
84
|
+
// declares kotlin-stdlib:2.1.20 as a runtime dep. Gradle's "highest
|
|
85
|
+
// version wins" conflict resolution would then upgrade the entire
|
|
86
|
+
// classpath to stdlib 2.1.20 — which the host RN 0.74 compiler (Kotlin
|
|
87
|
+
// 1.9) cannot read ("incompatible metadata: 2.1.0 > 2.0.0"). The SDK's
|
|
88
|
+
// classes were emitted with apiVersion=1.9 + languageVersion=1.9 +
|
|
89
|
+
// -Xskip-metadata-version-check, so the older stdlib at runtime is safe.
|
|
90
|
+
configurations.all {
|
|
91
|
+
resolutionStrategy {
|
|
92
|
+
def kv = getExtOrDefault('kotlinVersion', '1.9.22')
|
|
93
|
+
force "org.jetbrains.kotlin:kotlin-stdlib:${kv}"
|
|
94
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-common:${kv}"
|
|
95
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kv}"
|
|
96
|
+
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kv}"
|
|
97
|
+
}
|
|
98
|
+
}
|