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

EAS Build Failing Due To JSONSafeEncoding CocoaPod #368

Closed
itajenglish opened this issue Dec 29, 2024 · 18 comments
Closed

EAS Build Failing Due To JSONSafeEncoding CocoaPod #368

itajenglish opened this issue Dec 29, 2024 · 18 comments

Comments

@itajenglish
Copy link

SDK version:

customerio-expo-plugin": "^2.0.0-beta.1",
customerio-reactnative": "4.1.1"

Environment: Development or Production

  • Production

Are logs available?

Installing JSONSafeEncoding (2.0.0)
[!] Error installing JSONSafeEncoding
[!] /usr/bin/git -C /var/folders/k1/kt7yrxc10kj_s38cm7hbv_7c0000gn/T/d20241229-1876-klne10 rev-parse HEAD
fatal: not a git repository (or any of the parent directories): .git
[!] [Codegen] warn: using experimental new codegen integration
[!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `BE4070B6D4E048E29537D951` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Error: Unknown error. See logs of the Install pods build phase for more information.

Describe the bug

  • Expo EAS iOS build failing due to a dependency used by the CIO SDK

To Reproduce

  • Run an EAS build with the the Customer IO SDK and Expo Config plugin installed

Expected behavior

  • Build should succeed

Screenshots

Additional context

  • React Native Version: 0.74.5
  • Expo SDK Version: 51.0.31
  • Expo Workflow: Bare
@mahmoud-elmorabea
Copy link
Contributor

Hello,

Thanks for the report and sorry to see you are running into issues, can you please confirm if installing the pods locally works or not?

  • Locally run Expo prebuild after applying the CIO Expo plugin
  • It should already run pod install but if not, run it manually
  • Do you have the error? or is it only happening on EAS builds?

@itajenglish
Copy link
Author

itajenglish commented Dec 30, 2024

Hey @mahmoud-elmorabea, Thank you for the fast response. Yes, it works locally. The issue only happens when doing the build on EAS.

@itajenglish
Copy link
Author

@mahmoud-elmorabea, Seems like this was also reported in a previous issue - #353

@tarikfp
Copy link

tarikfp commented Jan 1, 2025

Is there any workaround for this one? Does downgrading the version of customerio-reactnative" to the 3.9.1 fix the issue while having customerio-expo-plugin": "^2.0.0-beta.1" ?

@itajenglish
Copy link
Author

Is there any workaround for this one? Does downgrading the version of customerio-reactnative" to the 3.9.1 fix the issue while having customerio-expo-plugin": "^2.0.0-beta.1" ?

I think v2.0 of the config plugin requires the latest version of the CIO SDK. I think when I tried an older version the build failed.

@mahmoud-elmorabea
Copy link
Contributor

Hello,

Just wanted to post a quick update of what we got so far.

Regarding CustomerIO SDK versions compatibility

  • CIO Expo plugin v2.x only works with CIO RN v4.x
  • CIO Expo plugin v1.x only works with CIO RN v3.x
  • Unfortunately, you cannot mix and match

Regarding the pod installation issue

I was able to setup my own EAS and was able to reproduce the issue indeed. I've traced the dependency JSONSafeEncoding through our RN/iOS SDKs and it seems to be setup correctly and we have RN test apps and Expo test app that works fine but they aren't using EAS, so that's strange.

I just want to confirm one thing before going on with the investigation: if you try to build the app locally do you have the same problem? Can you try the following:

  • Make sure you have the CIO Expo plugin configured
  • Run Expo prebuild locally to generate your ios project (if it's not already generated)
  • The previous step should automatically run pod install but if it doesn't, navigate to your ios directory and run pod install manually
  • Let us know if you have the same issue?

We don't use EAS in our setup and you can check out our test app for inspiration.

I think the next step (if we confirm that things work locally), would be to reach out to the Expo folks and check maybe EAS build is misconfigured somehow.

@itajenglish
Copy link
Author

Hey @mahmoud-elmorabea, Thanks for the update! The build works locally 100% fine and I'm able to see the JSONSafeEncoding pod is installed

@mahmoud-elmorabea
Copy link
Contributor

@itajenglish Thanks for the quick response!

That makes me think it's unlikely a CustomerIO SDK issue but rather the way an app is configured with EAS.

I will still continue investigation because even if the issue isn't with our SDK, we would like to be able to give our users helpful instructions on how to make things work with EAS as well.

@itajenglish
Copy link
Author

@itajenglish Thanks for the quick response!

That makes me think it's unlikely a CustomerIO SDK issue but rather the way an app is configured with EAS.

I will still continue investigation because even if the issue isn't with our SDK, we would like to be able to give our users helpful instructions on how to make things work with EAS as well.

Interesting! Thank you for this update. I will also open a support ticket with them and hope they can help resolve this.

@tarikfp
Copy link

tarikfp commented Jan 2, 2025

Thanks for your attention here @mahmoud-elmorabea The build works locally but fails on EAS Builld. However, it works if customerio-expo-plugin is removed from plugins array.

@mahmoud-elmorabea
Copy link
Contributor

Hey folks,

Quick update, I have been tinkering around and found couple of interesting things.

  1. It seems like EAS considers gitignore files in your project and any files included in the git ignore list are not uploaded to EAS and are not used during the EAS build, that could probably be the reason why builds run locally fine but fail on EAS, there is some config that is done correctly locally isn't getting picked up up by the EAS build
  2. I added a "eas-build-pre-install": "bash test.sh" in my test app package.json AND I removed gitignore files that ignore the native generated projects. That test.sh only runs npm install for the test app before any other steps and my pod install step starting succeeding. I have no idea why that would be the case but it did 😄

Like I mentioned, we don't use EAS so I'm not really an expert and there is probably a more reasonable way to configure EAS

@itajenglish
Copy link
Author

Hey guys, I have an update and good news!
@mahmoud-elmorabea, I tried the things you mentioned but neither worked for me. However, I found a solution that did work and it seems that the EAS CocoaPods Cache server is causing the problem. So I went ahead and disabled the cache for my builds and we have success.

https://docs.expo.dev/build-reference/caching/#ios-dependencies

@itajenglish
Copy link
Author

@mahmoud-elmorabea I did run into another error but I was able to resolve it by looking at the documentation for the previous version (1.0.0-beta.17) of the config plugin. I think this step in version 2.0.0-beta.1 of the config plugin may have been removed by accident.

Error:

Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
- No profiles for 'com.listedb.app.staging.richpush' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.listedb.app.staging.richpush'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'NotificationService' from project 'ListedBStaging')
Refer to "Xcode Logs" below for additional, more detailed logs.

@mahmoud-elmorabea
Copy link
Contributor

@itajenglish Thanks for reporting back and I've glad that you could resolve the issues 😇

I am closing this issue for now but please feel free to re-open or create new issues if you run in any other problems.

@erik-lissen
Copy link

hi @itajenglish
I have the same, issue, trying without cache right now to see if it works.
Were you able to re-enable the pod cache after having a successful build, or are we stuck with no-cache going forward? I assume this will take it's toll on build times

@itajenglish
Copy link
Author

hi @itajenglish
I have the same, issue, trying without cache right now to see if it works.
Were you able to re-enable the pod cache after having a successful build, or are we stuck with no-cache going forward? I assume this will take it's toll on build times

Hey @erik-lissen Wasn't able to re-enable after the build. So it seems we are stuck for now. I'll try again in a few months haha. It honestly didn't seem to make a huge difference in build time for me. However, I imagine it may be different for everyone.

@gitmazzio
Copy link

@mahmoud-elmorabea I did run into another error but I was able to resolve it by looking at the documentation for the previous version (1.0.0-beta.17) of the config plugin. I think this step in version 2.0.0-beta.1 of the config plugin may have been removed by accident.

Error:

Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
- No profiles for 'com.listedb.app.staging.richpush' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.listedb.app.staging.richpush'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'NotificationService' from project 'ListedBStaging')
Refer to "Xcode Logs" below for additional, more detailed logs.

Hi @itajenglish how did you manage this error? I'm facing the same error.

@itajenglish
Copy link
Author

@mahmoud-elmorabea I did run into another error but I was able to resolve it by looking at the documentation for the previous version (1.0.0-beta.17) of the config plugin. I think this step in version 2.0.0-beta.1 of the config plugin may have been removed by accident.
Error:

Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
- No profiles for 'com.listedb.app.staging.richpush' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.listedb.app.staging.richpush'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'NotificationService' from project 'ListedBStaging')
Refer to "Xcode Logs" below for additional, more detailed logs.

Hi @itajenglish how did you manage this error? I'm facing the same error.

Hey @gitmazzio Did this step not work for you?

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

No branches or pull requests

6 participants