Skip to content

Commit 919588c

Browse files
fix(mobile): make Android compile under SDK 58's Gradle plugins
Two patches for third-party packages that AGP 9 exposes: - expo-widgets resolves its layout registry script through a pnpm symlink, so the "am I the main module" path check never matched and the registry resource was silently skipped; comparing real paths lets it run. - @clerk/expo imports LocalSavedStateRegistryOwner and the Compose LocalLifecycleOwner but only got those artifacts transitively through navigation3; AGP 9 no longer leaks runtime constraints onto the compile classpath, so the module declares them itself. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 892fe62 commit 919588c

3 files changed

Lines changed: 38 additions & 7 deletions

File tree

‎patches/@[email protected]‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
diff --git a/android/build.gradle b/android/build.gradle
2+
index 6bd6d5acf6ac3da78232170a6ea8c2b0f6e5504e..a827dad53dcd8c1b2f47fce30ea8bf9140787f38 100644
3+
--- a/android/build.gradle
4+
+++ b/android/build.gradle
5+
@@ -146,6 +146,12 @@ dependencies {
6+
implementation "androidx.activity:activity-compose:$activityComposeVersion"
7+
implementation "androidx.lifecycle:lifecycle-runtime-compose:$lifecycleVersion"
8+
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion"
9+
+ // ClerkComposeNativeViewHost imports LocalSavedStateRegistryOwner and
10+
+ // LocalLifecycleOwner from these artifacts. Earlier SDKs leaked them onto
11+
+ // the compile classpath through clerk-android-ui's navigation3 runtime
12+
+ // dependency; AGP 9 resolves the compile classpath on its own.
13+
+ implementation "androidx.savedstate:savedstate-compose:1.4.0"
14+
+ implementation "androidx.lifecycle:lifecycle-runtime-compose:2.10.0"
15+
16+
testImplementation "junit:junit:4.13.2"
17+
}
118
diff --git a/ios/ClerkAuthNativeView.swift b/ios/ClerkAuthNativeView.swift
219
index 5f8d2ba66d5b232890af75c22b173c86d2ef546b..b170304cbf2fbaae8032db8dd6f89b6a59c6e3fe 100644
320
--- a/ios/ClerkAuthNativeView.swift

‎patches/[email protected]‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ index 4d135c4e4eb1f846315654ed9d835a935d120d42..dae47445b27516fa2464a25b68bddc8f
131131
if #available(iOS 18.0, *) {
132132
LiveActivityBanner(context: context, nodes: nodes)
133133
} else if let node = nodes["banner"] as? [String: Any] {
134+
diff --git a/scripts/build-layout-registry.mjs b/scripts/build-layout-registry.mjs
135+
index d52a60e342c8e0a8a1d78f7174da5e60e6bd1c53..fa9bd77c5c04d459038a5b4a00e1391780b406fa 100644
136+
--- a/scripts/build-layout-registry.mjs
137+
+++ b/scripts/build-layout-registry.mjs
138+
@@ -154,6 +154,8 @@ function createLayoutRegistry(expectedWidgets, capturedLayouts) {
139+
return registry;
140+
}
141+
142+
-if (process.argv[1] && path.resolve(process.argv[1]) === __filename) {
143+
+// Compare real paths: pnpm exposes the package through a symlink, so the
144+
+// invoked path and import.meta.url differ while naming the same file.
145+
+if (process.argv[1] && fs.realpathSync(path.resolve(process.argv[1])) === fs.realpathSync(__filename)) {
146+
await main();
147+
}
134148
diff --git a/src/Widgets.types.ts b/src/Widgets.types.ts
135149
index 07706139379384dae27befef4e3e5ae09d04a0db..924fa0029243664e369ce08c81e504b6300bfc7f 100644
136150
--- a/src/Widgets.types.ts

‎pnpm-lock.yaml‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)