Fastlane and EAS deploy to production error when adding Stripe
Managed workflow
eas-cli eas-cli/3.7.2 darwin-x64 node-v16.15.0
expo sdk 47
react-native: 0.70.5
Summary
I’m attempting to incorporate Stripe & Apple Pay using the Expo Documentation. I am getting a FastLane error when deploying with EAS to “production”. App works as expected in Simulator “development”.
eas.json
"base": {
"node": "16.15.0",
"yarn": "1.22.17",
"ios": {
"credentialsSource": "local",
"image": "latest",
"resourceClass": "m1-medium",
"env": {
"PLATFORM": "ios"
}
}
},
metro.config
const { getDefaultConfig } = require('@expo/metro-config');
const config = getDefaultConfig(__dirname);
// Remove all console logs in production ...
config.transformer.minifierConfig.compress.drop_console = true;
module.exports = config;
I install stripe:
$ npx expo install @stripe/stripe-react-native
› Installing 1 SDK 47.0.0 compatible native module using Yarn
> yarn add @stripe/stripe-react-native@0.19.0
Adding @stripe/stripe-react-native@0.19.0, note that the latest is 0.25.0.
I’ve created the Merchant ID and followed Stripe’s “Accept Apple Pay” documentation. The only step that I believe is not necessary, is “Integration with Xcode” since I’m using EAS production. Note that I am using local credentials.json. I assume that the merchant ID and Stripe API key in app.json are sufficient for the Apple Payment?
I’ve added to my app.json:
expo {
...
extra: {
stripe : {
apiKey: '<my api key>'
merchantIdentifier: '<my merchant id>'
},
},
..
plugins: [
[
"@stripe/stripe-react-native",
{
merchantIdentifier: '<my merchant id>'
}
]
],
...
}
I add React Native code to trigger an ApplePay request
Stripe Functions used
import { useApplePay, useStripe } from '@stripe/stripe-react-native';
import Button from '@core/components/Button';
import { TextSemiBold } from '@core/components/StyledText';
import Styles from '@core/constants/Styles';
import Constants from 'expo-constants';
import React, { useCallback } from 'react';
interface ApplePayButtonProps {
applePayLabel: string; // text passed to native Apple Pay via stripe "presentApplePay()"
label: string; // button text
amount: string;
}
export default function ApplePayButton({
applePayLabel,
label,
amount,
}: ApplePayButtonProps) {
const { confirmApplePayPayment } = useStripe();
const { presentApplePay } = useApplePay();
const handlePress = useCallback(async () => {
const { paymentMethod, error } = presentApplePay({
currency: 'usd',
country: 'US',
cartItems: [{ paymentType: 'Immediate', label: applePayLabel, amount }],
});
if (!error) {
const clientSecret = process.env.STRIPE_SECRET;
const { error: confirmApplePayError } = await confirmApplePayPayment(
clientSecret,
);
confirmApplePayPayment(clientSecret);
if (confirmApplePayError) {
console.log(confirmApplePayError.code, confirmApplePayError.message);
} else {
console.log('Success', 'The payment was confirmed successfully!');
}
}
}, [confirmApplePayPayment, presentApplePay]);
return (
<Button style={{ margin: 10 }} onPressOut={handlePress}>
<TextSemiBold style={Styles.h5}>{label}</TextSemiBold>
</Button>
);
}
I fail in fastlane on eas with this log output:
Creating Gymfile
Gymfile created
Successfully loaded '/Users/expo/workingdir/build/packages/native/ios/Gymfile' 📄
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Detected Values from './Gymfile' |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| suppress_xcode_output | true |
| clean | false |
| scheme | AppName |
| configuration | Release |
| export_options | |
| export_xcargs | OTHER_CODE_SIGN_FLAGS="--keychain /var/folders/rp/_x4mwf8x2f52ml0n3qt65jw80000gn/T/turtle-v2-bbf5d290-fd6d-424a-9ddb-cd9296f6037b.keychain" |
| disable_xcpretty | true |
| buildlog_path | /Users/expo/workingdir/logs |
| output_directory | ./build |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
Resolving Swift Package Manager dependencies...
$ xcodebuild -resolvePackageDependencies -workspace ./AppName.xcworkspace -scheme AppName -configuration Release
▸ Command line invocation:
▸ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -workspace ./AppName.xcworkspace -scheme AppName -configuration Release
▸ User defaults from command line:
▸ IDEPackageSupportUseBuiltinSCM = YES
▸ --- xcodebuild: WARNING: Using the first of multiple matching destinations:
▸ { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:0000FE00-66D45333AEB93EDA }
▸ { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
▸ { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
▸ { platform:iOS Simulator, id:94EE5B62-6A73-4410-8C64-A56FBFD9C55D, OS:16.2, name:iPad (10th generation) }
▸ { platform:iOS Simulator, id:537FF0C8-8B14-4E2E-9828-0ED246BE9E38, OS:16.2, name:iPad Air (5th generation) }
▸ { platform:iOS Simulator, id:777A520C-1C1B-484A-99C6-35943FA97067, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
▸ { platform:iOS Simulator, id:A5447295-3264-4816-9C78-50E5F35C1122, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
▸ { platform:iOS Simulator, id:067F74D9-EEC3-4066-B8A8-B3EAD0EE5649, OS:16.2, name:iPad mini (6th generation) }
▸ { platform:iOS Simulator, id:3A1FD6BA-A84C-4728-A0AA-E7D9DF147BA7, OS:16.2, name:iPhone 14 }
▸ { platform:iOS Simulator, id:5D252FD0-2816-4FAE-B85D-C29DC8D2C73C, OS:16.2, name:iPhone 14 Plus }
▸ { platform:iOS Simulator, id:AA475350-BBB4-4568-A722-4528CF187FA8, OS:16.2, name:iPhone 14 Pro }
▸ { platform:iOS Simulator, id:01B24393-FC59-4FEC-87FD-338E47BABDAE, OS:16.2, name:iPhone 14 Pro Max }
▸ { platform:iOS Simulator, id:88B2387A-FF6D-4979-9155-B06611A97148, OS:16.2, name:iPhone SE (3rd generation) }
▸ resolved source packages:
$ xcodebuild -showBuildSettings -workspace ./AppName.xcworkspace -scheme AppName -configuration Release
[stderr]
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
[stderr]
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:0000FE00-66D45333AEB93EDA }
[stderr]
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[stderr]
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[stderr]
{ platform:iOS Simulator, id:94EE5B62-6A73-4410-8C64-A56FBFD9C55D, OS:16.2, name:iPad (10th generation) }
[stderr]
{ platform:iOS Simulator, id:537FF0C8-8B14-4E2E-9828-0ED246BE9E38, OS:16.2, name:iPad Air (5th generation) }
[stderr]
{ platform:iOS Simulator, id:777A520C-1C1B-484A-99C6-35943FA97067, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
[stderr]
{ platform:iOS Simulator, id:A5447295-3264-4816-9C78-50E5F35C1122, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
[stderr]
{ platform:iOS Simulator, id:067F74D9-EEC3-4066-B8A8-B3EAD0EE5649, OS:16.2, name:iPad mini (6th generation) }
[stderr]
{ platform:iOS Simulator, id:3A1FD6BA-A84C-4728-A0AA-E7D9DF147BA7, OS:16.2, name:iPhone 14 }
[stderr]
{ platform:iOS Simulator, id:5D252FD0-2816-4FAE-B85D-C29DC8D2C73C, OS:16.2, name:iPhone 14 Plus }
[stderr]
{ platform:iOS Simulator, id:AA475350-BBB4-4568-A722-4528CF187FA8, OS:16.2, name:iPhone 14 Pro }
[stderr]
{ platform:iOS Simulator, id:01B24393-FC59-4FEC-87FD-338E47BABDAE, OS:16.2, name:iPhone 14 Pro Max }
[stderr]
{ platform:iOS Simulator, id:88B2387A-FF6D-4979-9155-B06611A97148, OS:16.2, name:iPhone SE (3rd generation) }
Command timed out after 3 seconds on try 1 of 4, trying again with a 6 second timeout...
[stderr]
2023-03-01 07:47:32.036 xcodebuild[8759:26747] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
[stderr]
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
[stderr]
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:0000FE00-66D45333AEB93EDA }
[stderr]
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[stderr]
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[stderr]
{ platform:iOS Simulator, id:94EE5B62-6A73-4410-8C64-A56FBFD9C55D, OS:16.2, name:iPad (10th generation) }
[stderr]
{ platform:iOS Simulator, id:537FF0C8-8B14-4E2E-9828-0ED246BE9E38, OS:16.2, name:iPad Air (5th generation) }
[stderr]
{ platform:iOS Simulator, id:777A520C-1C1B-484A-99C6-35943FA97067, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
[stderr]
{ platform:iOS Simulator, id:A5447295-3264-4816-9C78-50E5F35C1122, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
[stderr]
{ platform:iOS Simulator, id:067F74D9-EEC3-4066-B8A8-B3EAD0EE5649, OS:16.2, name:iPad mini (6th generation) }
[stderr]
{ platform:iOS Simulator, id:3A1FD6BA-A84C-4728-A0AA-E7D9DF147BA7, OS:16.2, name:iPhone 14 }
[stderr]
{ platform:iOS Simulator, id:5D252FD0-2816-4FAE-B85D-C29DC8D2C73C, OS:16.2, name:iPhone 14 Plus }
[stderr]
{ platform:iOS Simulator, id:AA475350-BBB4-4568-A722-4528CF187FA8, OS:16.2, name:iPhone 14 Pro }
[stderr]
{ platform:iOS Simulator, id:01B24393-FC59-4FEC-87FD-338E47BABDAE, OS:16.2, name:iPhone 14 Pro Max }
[stderr]
{ platform:iOS Simulator, id:88B2387A-FF6D-4979-9155-B06611A97148, OS:16.2, name:iPhone SE (3rd generation) }
[stderr]
2023-03-01 07:47:32.897 xcodebuild[8777:26854] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
Detected provisioning profile mapping: {:"com.balt.AppName"=>"c49fed13-e7df-40ac-a922-1dd0ef52d670"}
+--------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Summary for gym 2.211.0 |
+--------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| workspace | ./AppName.xcworkspace |
| scheme | AppName |
| clean | false |
| output_directory | ./build |
| output_name | AppName |
| configuration | Release |
| silent | false |
| skip_package_ipa | false |
| skip_package_pkg | false |
| export_options.method | app-store |
| export_options.provisioningProfiles.com.balt.AppName | c49fed13-e7df-40ac-a922-1dd0ef52d670 |
| export_xcargs | OTHER_CODE_SIGN_FLAGS="--keychain /var/folders/rp/_x4mwf8x2f52ml0n3qt65jw80000gn/T/turtle-v2-bbf5d290-fd6d-424a-9ddb-cd9296f6037b.keychain" |
| build_path | /Users/expo/Library/Developer/Xcode/Archives/2023-03-01 |
| result_bundle | false |
| buildlog_path | /Users/expo/workingdir/logs |
| destination | generic/platform=iOS |
| suppress_xcode_output | true |
| xcodebuild_formatter | xcpretty |
| disable_xcpretty | true |
| skip_profile_detection | false |
| 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 ./AppName.xcworkspace -scheme AppName -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/expo/Library/Developer/Xcode/Archives/2023-03-01/AppName\ 2023-03-01\ 07.47.33.xcarchive archive | tee /Users/expo/workingdir/logs/AppName-AppName.log > /dev/null
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 'Create Symlinks to Header Folders' 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 'React-bridging' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' 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 'RCT-Folly' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' 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 'fmt' from project 'Pods')
Run script build phase 'Create Symlinks to Header Folders' 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 'React-Codegen' 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 'AppName' from project 'AppName')
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 'AppName' from project 'AppName')
Run script build phase 'Upload source maps to Bugsnag' 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 'AppName' from project 'AppName')
Run script build phase '[CP-User] [RNFB] Core Configuration' 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 'AppName' from project 'AppName')
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.211.0 |
| sdk | iPhoneOS16.2.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: The "Run fastlane" step failed with an unknown error. Refer to "Xcode Logs" below for additional, more detailed logs.
If I go back to my main branch I do not have this error.
Do I need to include the certificate I created from the Stripe “Create a new Apple Pay certificate” documentation within my credentials.json?
I thought those credentials were taken from Stripe’s dashboard since my app authorizes Stripe via the <StripeProvider publishableKey={Constants.expoConfig.extra.stripe.apiKey} merchantIdentifier={Constants.expoConfig.extra.stripe.merchantIdentifier}>
using the merchant ID and the Stripe API key in app.json?