@@ -41,6 +41,7 @@ import DirectoryAlreadyExistsError from './errors/DirectoryAlreadyExistsError';
4141import { createTemplateUri } from './version' ;
4242import { TEMPLATE_COMMUNITY_REACT_NATIVE_VERSION } from './constants' ;
4343import type { Options } from './types' ;
44+ import { runCodegen } from '@react-native-community/cli-config-apple' ;
4445
4546const DEFAULT_VERSION = 'latest' ;
4647
@@ -280,11 +281,19 @@ async function createFromTemplate({
280281
281282 if ( process . platform === 'darwin' ) {
282283 const installPodsValue = String ( installCocoaPods ) ;
284+ const reactNativePath = path . dirname (
285+ require . resolve ( 'react-native' , { paths : [ projectDirectory ] } ) ,
286+ ) ;
283287
284288 try {
285289 if ( installPodsValue === 'true' ) {
286290 didInstallPods = true ;
287- await installPods ( loader ) ;
291+ await runCodegen ( {
292+ root : projectDirectory ,
293+ platform : 'ios' ,
294+ reactNativePath,
295+ } ) ;
296+ await installPods ( loader , { } ) ;
288297 loader . succeed ( ) ;
289298 setEmptyHashForCachedDependencies ( projectName ) ;
290299 } else if ( installPodsValue === 'undefined' ) {
@@ -298,7 +307,12 @@ async function createFromTemplate({
298307 didInstallPods = installCocoapods ;
299308
300309 if ( installCocoapods ) {
301- await installPods ( loader , { newArchEnabled : true } ) ;
310+ await runCodegen ( {
311+ root : projectDirectory ,
312+ platform : 'ios' ,
313+ reactNativePath,
314+ } ) ;
315+ await installPods ( loader , { } ) ;
302316 loader . succeed ( ) ;
303317 setEmptyHashForCachedDependencies ( projectName ) ;
304318 }
0 commit comments