I know this is solved but if anyone wants a solution using only expo (I'm a big expo fanboy right now)
Heres how you can modify the podfile like in Vivek's answer using an expo config plugin.
I also added an if statment to only update React-codegen
because it was the only one giving me issues after updating xcode to 14.3
// ./expo-plugins/fix-rn-codegen.js
const { withDangerousMod, withPlugins } = require("@expo/config-plugins");
const { ExpoConfig } = require("@expo/config-types");
const {
mergeContents,
} = require("@expo/config-plugins/build/utils/generateCode");
const { readFileSync, writeFileSync } = require("fs");
const { resolve } = require("path");
const withFixedDeploymentTarget = (c) => {
return withDangerousMod(c, [
"ios",
async (config) => {
const file = resolve(config.modRequest.platformProjectRoot, "Podfile");
const contents = readFileSync(file, { encoding: "utf-8" });
writeFileSync(file, fixDeploymentTarget(contents));
return config;
},
]);
};
function fixDeploymentTarget(src) {
return mergeContents({
tag: `rn-fix-deployment-target`,
src,
newSrc: `
installer.pods_project.targets.each do |target|
if target.to_s === 'React-Codegen'
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '5.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
`,
anchor: /post_install/,
offset: 1,
comment: "#",
}).contents;
}
module.exports = (config) => withPlugins(config, [withFixedDeploymentTarget]);
Then link it in app.json
// ./app.json
{
"expo": {
"plugins": [
["./expo-plugins/fix-rn-codegen.js"]
]
}
}