Files
fonsi_app/plugins/withPodsDeploymentTarget.js
riccardoandClaude Opus 5 5c66e9d5cb Upgrade to Expo SDK 57 for Xcode 27 support
- expo 57.0.23, react-native 0.86.3, react 19.2.3
- Remove @react-navigation/* direct deps (unsupported by expo-router 56+)
- Drop newArchEnabled and android.edgeToEdgeEnabled (removed from schema)
- Enable ios.enableSceneSupport (UIScene lifecycle required by iOS 27 SDK)
- Remove deprecated expo-build-properties deploymentTarget (default 16.4)
- Add withPodsDeploymentTarget plugin: raise CocoaPods resource bundle
  targets (RNCAsyncStorage, RNSVG, SDWebImage) to the app minimum
- Replace removed StyleSheet.absoluteFillObject with absoluteFill

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 12:54:53 +02:00

35 lines
1.4 KiB
JavaScript

const { withPodfile } = require('expo/config-plugins');
const MARKER = '# @generated withPodsDeploymentTarget';
// CocoaPods resource bundle targets (e.g. RNCAsyncStorage_resources, RNSVGFilters)
// keep the deployment target declared in their podspec, ignoring `platform :ios`.
// Xcode 27 rejects targets below iOS 15, so raise every pod target to the app's minimum.
const SNIPPET = `
${MARKER}
min_ios_target = podfile_properties['ios.deploymentTarget'] || '16.4'
installer.pods_project.targets.each do |target|
target.build_configurations.each do |build_config|
current = build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
if current.nil? || Gem::Version.new(current) < Gem::Version.new(min_ios_target)
build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_target
end
end
end
`;
module.exports = function withPodsDeploymentTarget(config) {
return withPodfile(config, (config) => {
const podfile = config.modResults;
if (podfile.contents.includes(MARKER)) {
return config;
}
const anchor = /post_install do \|installer\|\n/;
if (!anchor.test(podfile.contents)) {
throw new Error('withPodsDeploymentTarget: post_install block not found in Podfile');
}
podfile.contents = podfile.contents.replace(anchor, (match) => match + SNIPPET);
return config;
});
};