@@ -41,6 +41,7 @@ import DirectoryAlreadyExistsError from './errors/DirectoryAlreadyExistsError';
41
41
import { createTemplateUri } from './version' ;
42
42
import { TEMPLATE_COMMUNITY_REACT_NATIVE_VERSION } from './constants' ;
43
43
import type { Options } from './types' ;
44
+ import { runCodegen } from '@react-native-community/cli-config-apple' ;
44
45
45
46
const DEFAULT_VERSION = 'latest' ;
46
47
@@ -280,11 +281,19 @@ async function createFromTemplate({
280
281
281
282
if ( process . platform === 'darwin' ) {
282
283
const installPodsValue = String ( installCocoaPods ) ;
284
+ const reactNativePath = path . dirname (
285
+ require . resolve ( 'react-native' , { paths : [ projectDirectory ] } ) ,
286
+ ) ;
283
287
284
288
try {
285
289
if ( installPodsValue === 'true' ) {
286
290
didInstallPods = true ;
287
- await installPods ( loader ) ;
291
+ await runCodegen ( {
292
+ root : projectDirectory ,
293
+ platform : 'ios' ,
294
+ reactNativePath,
295
+ } ) ;
296
+ await installPods ( loader , { } ) ;
288
297
loader . succeed ( ) ;
289
298
setEmptyHashForCachedDependencies ( projectName ) ;
290
299
} else if ( installPodsValue === 'undefined' ) {
@@ -298,7 +307,12 @@ async function createFromTemplate({
298
307
didInstallPods = installCocoapods ;
299
308
300
309
if ( installCocoapods ) {
301
- await installPods ( loader , { newArchEnabled : true } ) ;
310
+ await runCodegen ( {
311
+ root : projectDirectory ,
312
+ platform : 'ios' ,
313
+ reactNativePath,
314
+ } ) ;
315
+ await installPods ( loader , { } ) ;
302
316
loader . succeed ( ) ;
303
317
setEmptyHashForCachedDependencies ( projectName ) ;
304
318
}
0 commit comments