@@ -74,6 +74,10 @@ def react_native_path(project_root, target_platform)
74
74
Pathname . new ( resolve_module ( react_native ) )
75
75
end
76
76
77
+ def target_product_type ( target )
78
+ target . product_type if target . respond_to? ( :product_type )
79
+ end
80
+
77
81
def generate_assets_catalog! ( project_root , target_platform , destination )
78
82
xcassets_src = project_path ( 'ReactTestApp/Assets.xcassets' , target_platform )
79
83
xcassets_dst = File . join ( destination , File . basename ( xcassets_src ) )
@@ -367,6 +371,8 @@ def make_project!(xcodeproj, project_root, target_platform, options)
367
371
} ,
368
372
:use_fabric => use_fabric ,
369
373
:use_turbomodule => use_turbomodule ,
374
+ :code_sign_identity => code_sign_identity || '' ,
375
+ :development_team => development_team || '' ,
370
376
}
371
377
end
372
378
@@ -449,6 +455,18 @@ def use_test_app_internal!(target_platform, options)
449
455
end
450
456
end
451
457
end
458
+
459
+ next unless target_product_type ( target ) == 'com.apple.product-type.bundle'
460
+
461
+ # Code signing of resource bundles was enabled in Xcode 14. Not sure if
462
+ # this is intentional, or if there's a bug in CocoaPods, but Xcode will
463
+ # fail to build when targeting devices. Until this is resolved, we'll just
464
+ # just have to make sure it's consistent with what's set in `app.json`.
465
+ # See also https://github.com/CocoaPods/CocoaPods/issues/11402.
466
+ target . build_configurations . each do |config |
467
+ config . build_settings [ 'CODE_SIGN_IDENTITY' ] ||= project_target [ :code_sign_identity ]
468
+ config . build_settings [ 'DEVELOPMENT_TEAM' ] ||= project_target [ :development_team ]
469
+ end
452
470
end
453
471
454
472
Pod ::UI . notice (
0 commit comments