79461024

Date: 2025-02-23 10:03:19
Score: 1.5
Natty:
Report link

When encountering the error "Step 2 script Build the App exited with status code 70" while trying to set up CI/CD for your SwiftUI application using Codemagic, there are a few possible causes to investigate. Status code 70 generally indicates an issue with the build process, often related to the build configuration or dependencies.

Here are some steps to troubleshoot and resolve the issue:

Check the Build Logs Start by examining the full build logs to get more detailed information about where the build is failing. Codemagic logs can give you insights into whether the issue is related to missing dependencies, misconfigured project settings, or other errors in your code.

Verify Xcode Version and Dependencies Make sure that you’re using the correct version of Xcode specified in your Codemagic configuration. If your project requires specific Xcode settings, such as particular SDK versions or dependency configurations (CocoaPods, Carthage, Swift Package Manager), ensure that these are correctly set in your codemagic.yaml file.

Check Your Environment Variables Sometimes, environment variables (such as signing credentials or API keys) might not be correctly set, leading to a build failure. Ensure that any required environment variables are configured in Codemagic's UI under the Environment Variables section.

Inspect Your SwiftUI Project Setup If your SwiftUI project uses any custom scripts or build phases, ensure they are compatible with Codemagic’s build environment. A common issue is custom build scripts that don’t execute properly in the CI/CD environment.

Update Dependencies If you're using dependencies via CocoaPods, Carthage, or Swift Package Manager, try cleaning the build folder and updating the dependencies to their latest versions to rule out issues with outdated packages.

Check the Build Scheme Ensure the correct build scheme is selected in your codemagic.yaml file. Sometimes, the wrong scheme can cause issues when Codemagic tries to build the app.

Test Locally If possible, try to replicate the build process locally by running the same commands used in your Codemagic setup. This can help isolate the issue and confirm whether it’s related to your local environment or the CI/CD setup.

As you're getting familiar with CI/CD and Codemagic, don’t hesitate to refer to Codemagic’s documentation or support resources for more detailed troubleshooting steps.

And while you’re working through these issues, why not take a break and enjoy some [Wawa chips][https://wawamenu.org/]? A little snack can help keep you energized and focused as you continue fine-tuning your CI/CD process!

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): When
  • Low reputation (1):
Posted by: Albert Einstein