Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullstory build failure #38

Open
eladgel opened this issue Aug 9, 2024 · 0 comments
Open

Fullstory build failure #38

eladgel opened this issue Aug 9, 2024 · 0 comments

Comments

@eladgel
Copy link

eladgel commented Aug 9, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @bacons/[email protected] for the project I'm working on.

When using this library at the same time as the Fullstory expo, your app will fail when building.

Why?
This function is asynchronous:

const withXcodeChanges = (config, props) => {
    return (0, withXcparse_1.withXcodeProjectBeta)(config, (config) => {
        // @ts-ignore
        applyXcodeChanges(config, config.modResults, props);
        return config;
    });
};

The problem is the Info.plist doesn't get copied in time for the FS plugin to run, resulting in a build failure.

This results in the Build phase of this project being added after the FS one.

image

You also need to comment out that part in the FS RN plugin

image

After change
image

I created this repo for easy reproducible scenario
https://github.com/eladgel/fullstory-collision

Here is the diff that solved my problem:

diff --git a/node_modules/@bacons/apple-targets/build/index.js b/node_modules/@bacons/apple-targets/build/index.js
index 79eead5..e136ebd 100644
--- a/node_modules/@bacons/apple-targets/build/index.js
+++ b/node_modules/@bacons/apple-targets/build/index.js
@@ -15,6 +15,7 @@ const withTargetsDir = (config, { appleTeamId, root = "./targets", match = "*" }
         cwd: projectRoot,
         absolute: true,
     });
+
     targets.forEach((configPath) => {
         config = (0, withWidget_1.default)(config, {
             appleTeamId,
diff --git a/node_modules/@bacons/apple-targets/build/withXcodeChanges.js b/node_modules/@bacons/apple-targets/build/withXcodeChanges.js
index ef64d1b..c0786c8 100644
--- a/node_modules/@bacons/apple-targets/build/withXcodeChanges.js
+++ b/node_modules/@bacons/apple-targets/build/withXcodeChanges.js
@@ -879,6 +879,7 @@ async function applyXcodeChanges(config, project, props) {
             });
         }
         else {
+            console.log("Embedding extension in main app");
             mainAppTarget.createBuildPhase(xcode_1.PBXCopyFilesBuildPhase, {
                 dstSubfolderSpec: 13,
                 buildActionMask: 2147483647,
@@ -886,6 +887,12 @@ async function applyXcodeChanges(config, project, props) {
                 name: WELL_KNOWN_COPY_EXTENSIONS_NAME,
                 runOnlyForDeploymentPostprocessing: 0,
             });
+            mainAppTarget.createBuildPhase(xcode_1.PBXShellScriptBuildPhase,{
+                name: "Run FullStory Asset Uploader Patched",
+                shellPath: "/bin/sh",
+                shellScript: "${PODS_ROOT}/FullStory/tools/FullStoryCommandLine ${CONFIGURATION_BUILD_DIR}/${WRAPPER_NAME}",
+                
+            });
         }
     }
     const mainSourcesBuildPhase = mainAppTarget.getBuildPhase(xcode_1.PBXSourcesBuildPhase);

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant