Skip to content

Commit 48dc2bc

Browse files
chriscaninclaude
andcommitted
fix(expo): restore Kotlin metadata skip in app.plugin.js for 1.0.9
The kotlin-stdlib 2.3.10 is still pulled in transitively even with clerk-android-ui 1.0.9. The app-level config plugin must inject -Xskip-metadata-version-check into the app's kotlinOptions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7b8de79 commit 48dc2bc

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

packages/expo/app.plugin.js

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
* Native modules are registered via react-native.config.js and standard
1010
* React Native autolinking (RCTViewManager / ReactPackage).
1111
*/
12-
const { withXcodeProject, withDangerousMod, withInfoPlist, withAppBuildGradle } = require('@expo/config-plugins');
12+
const {
13+
withXcodeProject,
14+
withDangerousMod,
15+
withInfoPlist,
16+
withAppBuildGradle,
17+
withEntitlementsPlist,
18+
} = require('@expo/config-plugins');
1319
const path = require('path');
1420
const fs = require('fs');
1521

@@ -507,6 +513,26 @@ const withClerkAndroid = config => {
507513
console.log('✅ Clerk Android packaging exclusions added');
508514
}
509515

516+
// --- Kotlin metadata version check skip ---
517+
if (!buildGradle.includes('-Xskip-metadata-version-check')) {
518+
const kotlinOptionsMatch = buildGradle.match(/kotlinOptions\s*\{/);
519+
if (kotlinOptionsMatch) {
520+
buildGradle = buildGradle.replace(
521+
/kotlinOptions\s*\{/,
522+
`kotlinOptions {\n // Clerk: allow reading metadata from newer Kotlin versions\n freeCompilerArgs += ['-Xskip-metadata-version-check']`,
523+
);
524+
} else {
525+
const androidMatch = buildGradle.match(/android\s*\{/);
526+
if (androidMatch) {
527+
buildGradle = buildGradle.replace(
528+
/android\s*\{/,
529+
`android {\n kotlinOptions {\n // Clerk: allow reading metadata from newer Kotlin versions\n freeCompilerArgs += ['-Xskip-metadata-version-check']\n }`,
530+
);
531+
}
532+
}
533+
console.log('✅ Clerk Android Kotlin metadata version check skip added');
534+
}
535+
510536
modConfig.modResults.contents = buildGradle;
511537
return modConfig;
512538
});
@@ -572,8 +598,23 @@ const withClerkKeychainService = (config, { keychainService } = {}) => {
572598
});
573599
};
574600

601+
/**
602+
* Add Sign in with Apple entitlement to the iOS app.
603+
* Required for the native Apple Sign In flow via ASAuthorizationController.
604+
*/
605+
const withClerkAppleSignIn = config => {
606+
return withEntitlementsPlist(config, modConfig => {
607+
if (!modConfig.modResults['com.apple.developer.applesignin']) {
608+
modConfig.modResults['com.apple.developer.applesignin'] = ['Default'];
609+
console.log('✅ Added Sign in with Apple entitlement');
610+
}
611+
return modConfig;
612+
});
613+
};
614+
575615
const withClerkExpo = (config, props = {}) => {
576616
config = withClerkIOS(config);
617+
config = withClerkAppleSignIn(config);
577618
config = withClerkGoogleSignIn(config);
578619
config = withClerkAndroid(config);
579620
config = withClerkKeychainService(config, props);

0 commit comments

Comments
 (0)