iosxcodereact-nativeexpoxcode15

Cycle inside <Target>; building could produce unreliable results. Xcode 15 React Native


I was using "react-native": "0.72.3" with Xcode 14, and everything was working perfectly but when I updated Xcode to Xcode 15. then it is giving error like below

Note: I was using Live Activity and Dynamic Island widget extension and two notification widget extensions.

Showing Recent Messages
Cycle inside <Target>; building could produce unreliable results.
Cycle details:
→ Target '<Target>': ExtractAppIntentsMetadata
○ Target '<Target>' has copy command from '/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex' to '/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex'
○ That command depends on command in Target '<Target>': script phase “[CP-User] [RNFB] Core Configuration”
○ Target '<Target>' has process command with output '/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/Info.plist'
○ Target '<Target>' has copy command from '/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex' to '/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex'

enter image description here


Solution

  • If you are using Firebase packages then you can try Firebase solutions otherwise you can try Other Solutions

    Firebase Solutions

    it happens when you are using firebase pods like this in Podfile

      pod 'nanopb', :modular_headers => true
      pod 'FirebaseSessions', :modular_headers => true
      pod 'Firebase', :modular_headers => true
      pod 'FirebaseCore', :modular_headers => true
      pod 'FirebaseCoreExtension', :modular_headers => true
      pod 'FirebaseInstallations', :modular_headers => true
      pod 'GoogleDataTransport', :modular_headers => true
      pod 'FirebaseCrashlytics', :modular_headers => true
      pod 'GoogleUtilities', :modular_headers => true
      pod 'CleverTap-iOS-SDK', :modular_headers => true
    

    Solution1:

    you can choose either Manual way or do Patch Package way

    Manual:

    if you wanna use :modular_headers => true pods then you can try this solution

    1. Goto ProjectTarget -> Build Phases
    2. Expand [RNFB] Core Configuration
    3. replace Input Files with $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) from $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

    enter image description here 4. Go to [CP_user][RNFB] Crashlytics Configuration BuildPhase and Expland it

    1. remove ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME} as Input Files enter image description here
    2. Run Build

    Package patch

    1. install patch-package
    2. Apply two patches like below

    @react-native-firebase+app+18.3.0.patch

    diff --git a/node_modules/@react-native-firebase/app/react-native.config.js b/node_modules/@react-native-firebase/app/react-native.config.js
    index 8502984..de75804 100644
    --- a/node_modules/@react-native-firebase/app/react-native.config.js
    +++ b/node_modules/@react-native-firebase/app/react-native.config.js
    @@ -10,7 +10,7 @@ module.exports = {
                 name: '[RNFB] Core Configuration',
                 path: './ios_config.sh',
                 execution_position: 'after_compile',
    -            input_files: ['$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)'],
    +            input_files: ['$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)'],
               },
             ],
           },
    

    @react-native-firebase+crashlytics+18.3.0.patch

    diff --git a/node_modules/@react-native-firebase/crashlytics/react-native.config.js b/node_modules/@react-native-firebase/crashlytics/react-native.config.js
    index 5f6c5f1..0fc785f 100644
    --- a/node_modules/@react-native-firebase/crashlytics/react-native.config.js
    +++ b/node_modules/@react-native-firebase/crashlytics/react-native.config.js
    @@ -24,7 +24,6 @@ module.exports = {
                 path: './ios_config.sh',
                 execution_position: 'after_compile',
                 input_files: [
    -              '${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}',
                   '$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)',
                 ],
               },
    
    
    1. install pod by pod install command
    2. Run Build.

    Solution 2

    if you dont wanna use :modular_headers => true then

    1. enable this 'use_frameworks! :linkage => :static' line into your Podfile
    2. run pod install command into your terminal
    3. Run Build

    Other Solutions

    Solution 1:

    In build phases, move the Embed Frameworks build phase above the Run script. run build.

    enter image description here

    Solution 2:

    In build phases, move the Run Script build phase to the end of the list. run build. enter image description here

    Solution 3:

    In build phases, move "Embed Foundation Extensions" build phase above the "[CP] Embed Pods Frameworks". run build.

    enter image description here

    Solution 4:

    1. In Xcode, go to File -> Workspace Settings
    2. Click on Advanced button
    3. Select the Legacy radio button
    4. run build