expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
842 stars 85 forks source link

EAS build fastlane fails with associatedDomains #1687

Closed gpawlik closed 1 year ago

gpawlik commented 1 year ago

Build/Submit details page URL

No response

Summary

After I added the associatedDomains value to the app.config.js he EAS build fails on the "Run fastlane" step with the Error 65. Without associatedDomains all works well.

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.2 Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.5.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.3.1 - /opt/homebrew/bin/npm Watchman: 2023.01.23.00 - /opt/homebrew/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 IDEs: Xcode: 14.2/14C18 - /usr/bin/xcodebuild npmGlobalPackages: expo-cli: 6.3.0 Expo Workflow: managed

expo-cli doctor 🎉 Didn't find any issues with the project!

Error output

No response

Reproducible demo or steps to reproduce from a blank project

This is the "ios" section of my app.config.js:

    ios: {
      supportsTablet: true,
      bundleIdentifier: "my.bundle.identifier",
      usesAppleSignIn: true,
      bitcode: "Debug",
      associatedDomains: ["applinks:my-domain.com"],
      googleServicesFile: "./GoogleService-Info.plist",
    },

The error that I am getting in the "Run fastlane" step is very generic:

...
| xcodebuild_command                             | xcodebuild                                                                                                                                  |
| skip_package_dependencies_resolution           | false                                                                                                                                       |
| disable_package_automatic_updates              | false                                                                                                                                       |
| use_system_scm                                 | false                                                                                                                                       |
| xcode_path                                     | /Applications/Xcode.app                                                                                                                     |
+------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
$ set -o pipefail && xcodebuild -workspace ./MyProject.xcworkspace -scheme MyProject -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/expo/Library/Developer/Xcode/Archives/2023-02-10/MyProject\ 2023-02-10\ 13.30.03.xcarchive archive | tee /Users/expo/workingdir/logs/MyProject-MyProject.log > /dev/null
    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyProject' from project 'MyProject')
    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
    Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
â–¸ ** ARCHIVE FAILED **
** ARCHIVE FAILED **
Exit status: 65
+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.210.0                 |
| sdk         | iPhoneOS16.0.sdk        |
+-------------+-------------------------+
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there
[stderr] [!] Error building the application - see the log above
Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
sophiapubgame commented 1 year ago

I got similar error logs.

In my case, I added associatedDomains in app.json, and execute " eas build -p ios " successfully.

    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.sophiadeng.AwesomeProject",
      "associatedDomains": ["applinks:expotest.onelink.me"]
    },

Then, I need to add Apple Login therefore I execute " yarn add expo-apple-authentication " and add reference config in app.json plugins:

        "plugins": [
            ["react-native-appsflyer", { "shouldUseStrictMode": false }],
            "expo-apple-authentication"
        ]

After execute "eas build -p ios" I got "ARCHIVE FAILED" eror like the following:

$ set -o pipefail && xcodebuild -workspace ./ccappv1.xcworkspace -scheme ccappv1 -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/expo/Library/Developer/Xcode/Archives/2023-02-10/ccappv1\ 2023-02-10\ 21.33.23.xcarchive archive | tee /Users/expo/workingdir/logs/ccappv1-ccappv1.log > /dev/null
    Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ccappv1' from project 'ccappv1')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ccappv1' from project 'ccappv1')
â–¸ ** ARCHIVE FAILED **
** ARCHIVE FAILED **
Exit status: 65
+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.210.0                 |
| sdk         | iPhoneOS16.0.sdk        |
+-------------+-------------------------+
Looks like fastlane ran into a build/archive error with your project
It's hard to tell what's causing the error, so we wrote some guides on how
to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
Before submitting an issue on GitHub, please follow the guide above and make
sure your project is set up correctly.
fastlane uses `xcodebuild` commands to generate your binary, you can see the
the full commands printed out in yellow in the above log.
Make sure to inspect the output above, as usually you'll find more error information there
[stderr] [!] Error building the application - see the log above
Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.        

Does the associatedDomains setting conflict with other plugins ( like Apple Login expo-apple-authentication ) ?

dsokal commented 1 year ago

Can you please share:

gpawlik commented 1 year ago

@sophiapubgame I have realised that this error happens because the CI does not update the capabilities correctly (as it was missing Apple credentials). When I have run the eas build ... locally it got updated correctly and the build succeeded.

tsheaff commented 1 year ago

@gpawlik glad that worked for you. However, I don't think what you're saying to simply run eas build ... locally is a general solution. I'm running eas build locally, not in a CI, and am experiencing this issue. Until we have more reliable fix steps that resolve this for everyone, I suggest we re-open this issue.

My symptoms

Very similar to what others described, but documenting here for clarity. By just removing the expo.ios.associatedDomains key I am getting a successful build, but when I add that back with value ['applinks:*.mydomain.com'] I get this error just like others report in the Run fastlane step in the expo.dev console:

$ set -o pipefail && xcodebuild -workspace ./Mental.xcworkspace -scheme Mental -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/expo/Library/Developer/Xcode/Archives/2023-02-19/Mental\ 2023-02-19\ 21.09.58.xcarchive archive | tee /Users/expo/workingdir/logs/Mental-Mental.log > /dev/null

    Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')

    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')

    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Mental' from project 'Mental')

    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Mental' from project 'Mental')

    Run script build phase 'Upload Debug Symbols to Sentry' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Mental' from project 'Mental')

â–¸ ** ARCHIVE FAILED **

** ARCHIVE FAILED **

Exit status: 65

+-------------+-------------------------+

|           Build environment           |

+-------------+-------------------------+

| xcode_path  | /Applications/Xcode.app |

| gym_version | 2.210.0                 |

| sdk         | iPhoneOS16.0.sdk        |

+-------------+-------------------------+

Looks like fastlane ran into a build/archive error with your project

It's hard to tell what's causing the error, so we wrote some guides on how

to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/

Before submitting an issue on GitHub, please follow the guide above and make

sure your project is set up correctly.

fastlane uses `xcodebuild` commands to generate your binary, you can see the

the full commands printed out in yellow in the above log.

Make sure to inspect the output above, as usually you'll find more error information there
gpawlik commented 1 year ago

@tsheaff are you sure when you run the eas build locally you are being logged in to the AppStore correctly? When adding the associatedDomains eas needs AppStore credentials to regenerate the provisional profiles to add the extra capability. The information about adding the capabilities should be also visible in the output of the eas build command.

tsheaff commented 1 year ago

Yup you're spot on. The reason I was consistently seeing this is that I was using --non-interactive and it wasn't logging me into the app store. Once I ran eas build without --non-interactive, it asked me to log into App Store Connect before submitting the build, and the build succeeded.

For posterity, anyone experiencing this while running eas build locally should not use the --non-interactive flag

Thanks @gpawlik makes sense to keep this closed.

mrtry commented 11 months ago

I have same problem. I'm having trouble with the --non-intaractive option when building with CI. :sob:

pehoracek commented 4 months ago

Removing --non-interactive did the trick for me 🥳