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

SDK 49 - eas build ios failed on "run fastlane" #2109

Open
johnfau opened this issue Nov 3, 2023 · 62 comments
Open

SDK 49 - eas build ios failed on "run fastlane" #2109

johnfau opened this issue Nov 3, 2023 · 62 comments
Labels
eas build needs review Issue is ready to be reviewed by a maintainer

Comments

@johnfau
Copy link

johnfau commented Nov 3, 2023

Build/Submit details page URL

https://expo.dev/accounts/johnfa/projects/carles-connect/builds/5f04dc92-7dbc-42c8-9f9f-bb1dac0c7b2c#run-fastlane

Summary

We started a new project with expo 49. It errors with the following message :

Build failed: The "Run fastlane" step failed with an unknown error. Refer to "Xcode Logs" below for additional, more detailed logs.

We don't see any errors in Xcode logs, I put the end of the log on the Error ouput below.

Another project on the same expo account, same computer, same ios credentials (except for provisionning) on expo 47 still builds correctly.

We don't have any Mac device to test a local build which make the issue extra-difficult to understand. We tried suggestion from #2024 and expo/expo#25105 but the error remained.

Managed or bare?

managed

Environment

expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 18.6.0 - C:\Program Files\nodejs\node.EXE
npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@expo/webpack-config: ^19.0.0 => 19.0.0
expo: ~49.0.11 => 49.0.16
react: 18.2.0 => 18.2.0
react-native: 0.72.6 => 0.72.6
react-native-web: ~0.19.6 => 0.19.9
Expo Workflow: managed

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Error output

Build failed: The "Run fastlane" step failed with an unknown error. Refer to "Xcode Logs" below for additional, more detailed logs.

    /usr/bin/codesign --force --sign REDACTED --entitlements /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/IntermediateBuildFilesPath/AppNameRedacted.build/Release-iphoneos/AppNameRedacted.build/AppNameRedacted.app.xcent --generate-entitlement-der /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app

RegisterExecutionPolicyException /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app (in target 'AppNameRedacted' from project 'AppNameRedacted')

    cd /Users/expo/workingdir/build/ios

    builtin-RegisterExecutionPolicyException /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app

Validate /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app (in target 'AppNameRedacted' from project 'AppNameRedacted')

    cd /Users/expo/workingdir/build/ios

    builtin-validationUtility /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app

Touch /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app (in target 'AppNameRedacted' from project 'AppNameRedacted')

    cd /Users/expo/workingdir/build/ios

    /usr/bin/touch -c /Users/expo/Library/Developer/Xcode/DerivedData/AppNameRedacted-REDACTED/Build/Intermediates.noindex/ArchiveIntermediates/AppNameRedacted/InstallationBuildProductsLocation/Applications/AppNameRedacted.app

Reproducible demo or steps to reproduce from a blank project

run eas build --platform ios from my expo account on a project with expo ~49.0.11

{
  "name": "app",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/webpack-config": "^19.0.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "axios": "^1.5.0",
    "expo": "~49.0.11",
    "expo-asset": "~8.10.1",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.11",
    "expo-file-system": "~15.4.4",
    "expo-font": "~11.4.0",
    "expo-intent-launcher": "~10.7.0",
    "expo-linear-gradient": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-media-library": "~15.4.1",
    "expo-router": "^2.0.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "nativewind": "^2.0.11",
    "react": "18.2.0",
    "react-native": "0.72.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-svg": "13.9.0",
    "react-native-toast-message": "^2.1.7",
    "react-native-view-shot": "3.7.0",
    "react-native-web": "~0.19.6",
    "react-native-webview": "13.2.2",
    "expo-network": "~5.4.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@expo/vector-icons": "^13.0.0",
    "@uidotdev/usehooks": "^2.4.0",
    "js-base64": "^3.7.5",
    "lodash-es": "^4.17.21",
    "react-native-anchor-point": "^1.0.6",
    "react-native-element-dropdown": "^2.10.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-outside-press": "^1.2.1",
    "react-native-snap-carousel": "^4.0.0-beta.6",
    "tailwindcss": "3.3.2"
  },
  "private": true
}

@johnfau johnfau added the needs review Issue is ready to be reviewed by a maintainer label Nov 3, 2023
@iam-rohid
Copy link

I'm also having the same issue

@jake-stewart
Copy link

I am facing the same issue

@LaKrue
Copy link

LaKrue commented Nov 8, 2023

Not sure if it's related, but I had errors like that. Building without associatedDomains in app.json for iOS linking worked, but failed with it. As hinted in #1687 I ran my build command without --non-interactive and it worked. Should note that I also deleted kind of everything app related from my apple dev account to have it regenerated.

@jwNorwood
Copy link

I am running into the same issue, works on Expo 47, iOS build fails on 48/49 but android build works.

@johnfau
Copy link
Author

johnfau commented Nov 8, 2023

I don't use associatedDomains.
I always run build without --non-interactive.
Dev builds are working fine for both android and ios. I can use the app on the ad-hoc provisioned iphone device. Only the production build for iOS is failing eas build --platform ios

› Generating debug CConnect » CConnect .app.dSYM

› Executing CConnect » Bundle React Native code and images

    Bundler cache is empty, rebuilding (this may take a minute)

› Executing CConnect » [CP] Copy Pods Resources

› Executing CConnect » [CP] Embed Pods Frameworks

› Signing   CConnect » CConnect .app

› Creating  CConnect » CConnect .app

    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')

▸ ** ARCHIVE FAILED **

2023-11-08 02:06:10.948 xcodebuild[4670:13722] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)

** ARCHIVE FAILED **

Exit status: 65

@sascha93
Copy link

I am running into the same issue, works on Expo 47, iOS build fails on 48/49 but android build works.

same here

@szdziedzic
Copy link
Member

Hi,

This issue seems super weird and I feel like it can be related to some issues with your credentials. Did you verify that all of your certificates are valid on the Apple Developer Portal?

@johnfau
Copy link
Author

johnfau commented Nov 14, 2023

Hi,

This issue seems super weird and I feel like it can be related to some issues with your credentials. Did you verify that all of your certificates are valid on the Apple Developer Portal?

Yes, I even recreated fresh certificates, profiles and identifiers as suggested in #2024 . I didnt delete them as we are using them on another project but if it is necessary we can try

@szdziedzic
Copy link
Member

Can you try to run a simulator build? If the issue itself is related to credentials, which sim builds don't use, it should work well.

@johnfau
Copy link
Author

johnfau commented Nov 15, 2023

Can you try to run a simulator build? If the issue itself is related to credentials, which sim builds don't use, it should work well.

Yes simulator build is working well.

I deleted all certificates and profiles from apple developer account. I couldn't delete Identifiers from apple developer account as I get a message "The App ID 'XXX' appears to be in use by the App Store".

I ran again eas build ios , new certificate and profiles have been created but the build failed with the same error.

@szdziedzic
Copy link
Member

Are you using local credentials or credentials managed by EAS?

@johnfau
Copy link
Author

johnfau commented Nov 15, 2023

We are using the default method which I think is managed by EAS. I can see all my certificates and keys on my expo.dev account.

@BogdanJWK
Copy link

BogdanJWK commented Nov 28, 2023

Any update? I'm going through the same thing, no solution so far.
Edit: In the meantime I decided to use eas remote build which works fine, but would still like to build locally.

@Christian-Mugumwa
Copy link

Going through the same issue here too

@andrewminton
Copy link

Having same issue on SDK 46,47,49. Can't deploy at all here. Frustrating error that wasn't here 2 months ago. Any updates/workarounds?

@humbroll
Copy link

humbroll commented Dec 5, 2023

Got the same issue. Has anyone figured out solution ?

@Christian-Mugumwa
Copy link

@humbroll @andrewminton So I fixed this by going into app.json and changing "bundleIdentifier" to something unique. Initially just changed it to a random number (try make it as random as possible). Then later changed it to com.myname.app and it worked.

I think the issue resides in that it has to be unique for some reason. I hope this works for you.

@johnfau
Copy link
Author

johnfau commented Dec 5, 2023

@humbroll @andrewminton So I fixed this by going into app.json and changing "bundleIdentifier" to something unique. Initially just changed it to a random number (try make it as random as possible). Then later changed it to com.myname.app and it worked.

I think the issue resides in that it has to be unique for some reason. I hope this works for you.

I did it, generated new distribution certificate and provisionning profile but still got the exact same error.

@dattx1
Copy link

dattx1 commented Dec 13, 2023

--local --non-interactive it's worked for me, thank @LaKrue saved my day

@johnfau
Copy link
Author

johnfau commented Dec 14, 2023

--non-intereactive doesnt help.

We finally got a Mac (the very thing we wanted to avoid using eas...) and tried to build on it we the same result. Here is the full log of a failed build from project creation to error. We used the basic project template, expo project creation and new certificate and profile creation. It is basically :

npx create-expo-app frbeprojo001
cd frbeprojo001
npm run ios
> iOs bundling complete and project opens correctly in iPhone emulator
npx eas-cli@latest build:configure
npx eas-cli@latest build --platform ios --local
> RUN_FASTLANE error, Archive failed  

eas-cli-build-error.pdf

I have no idea what other test I could do from there. I guess the error in related to something in our apple developer account but buying a new account for test purpose seems a bit much.

@dattx1
Copy link

dattx1 commented Dec 14, 2023

eas build -p ios -e sit --clear-cache --local --non-interactive
This is my build command, after add the --non-interactive agr i can build normaly

@johnfau
Copy link
Author

johnfau commented Dec 14, 2023

No change

@BogdanJWK
Copy link

I eventually switched to build my app from Xcode. I had some credentials/provision issues and recreated all of them in order to make it work. EAS fails with a different error now, regarding my ad-hoc credentials, but for the moment I consider building exclusively from xcode.

@ahmed-khlifi
Copy link

ahmed-khlifi commented Dec 14, 2023

Any updates about this issue ? ( Am on SDK 48 )

@dattx1
Copy link

dattx1 commented Dec 19, 2023

Clean Xcode project build (production => clean build folder)

Close Xcode

Open terminal

Run cd ~/Library/Developer/Xcode/DerivedData && open .

Delete all item in folder

Open terminal and cd to project

yarn && npx pod-install ios

Open Xcode

Wait to Xcode index project

After Xcode finish index project => Start build (command + B)

After build finish run eas build -p ios -e sit --clear-cache --local --non-interactive

Please wait the xcode finish all step

@Just-Moh-it
Copy link

Having the same issue... tried everything in the thread but still failing at fastlane. If it helps, cloud builds and simulator builds work.

@johnfau
Copy link
Author

johnfau commented Jan 11, 2024

I was able to publish on Mac using Xcode and @dattx1 steps. Build on eas still errors even when I try to use the provisioning and certificate created by Xcode.
Having to use a MAC to publish is a big step back for us :(

@weetos
Copy link

weetos commented Jan 15, 2024

Hello friends,
I also was struggling with this issue past days! Drived me crazy!
Because at best the xcode build logs were misleading me... and very much like all of you Expo x Fastlane was throwing nothing more than error 65.
So what I did is to clean all my project and rebuild it, step by step, to find what was breaking my bundling.
Here are my findings:

  1. I am using @react-navigation/stack for my navigation between screens. For whatever reason the following options {{ headerShown: false, presentation: 'card', animationTypeForReplace: 'pop', animation: 'slide_from_right' }}
    caused the bundling to fail on iOS. I figured that it wasn't too happy with the props animation. So I removed it.

  2. In my StyleSheet I had a duplicated key.

Now it's bundling like a charm ;)

But seriously the error log management is horrible!

I hope it will help some of you out there...

@andreibardas
Copy link

tried multiple possible solutions, nothing worked so far

@gustavo-fior
Copy link

--local --non-interactive it's worked for me, thank @LaKrue saved my day

THIS MAN IS A GOD AMONG HUMANS.

3 days of this bullshit, thanks a lot man

@murat0
Copy link

murat0 commented Feb 1, 2024

Clearing the derived data and letting the script to build it again is precisely what worked for us;

rm -rf ~/Library/Developer/Xcode/DerivedData/*

@CapleaIonut-Alexandru
Copy link

I have the same issue, nothing works from here

@andreibardas
Copy link

Tried everything here but nothing works. Anyone found a solution for this? I am thinking about starting a new project with the latest expo version and copy pasting every component manually and running builds until I see something that breaks the build.

@VadymBezsmertnyi
Copy link

@andreibardas
I am facing the same issue

@shahidul5
Copy link

shahidul5 commented Feb 28, 2024

@andreibardas any solution? I'm facing the same issue.

@VadymBezsmertnyi
Copy link

@dev-shahidul
It helped me:

  1. npx react-native-clean-project

  2. npx expo-doctor

  3. npx expo install --fix

  4. npx expo prebuild --clean
    Opened Xcode and waited until everything checked out and the first time without warnings.

  5. ran the command from package.json: "ios": "expo run:ios",

@EmanuelOcampo
Copy link

@VadymBezsmertnyi
it works for me thanks

@debashreecbnits
Copy link

@VadymBezsmertnyi you are a savior..thanks

@mikeRChambers610
Copy link

I am getting this issues as well and so far all of the above comment suggestions have not worked for me. The build was working fine on SDK 49 and now not working for me anymore once upgrading to SDK 51. My dev build was perfectly fine in the expo go app.

@lalobecerra7
Copy link

@dev-shahidul It helped me:

  1. npx react-native-clean-project
  2. npx expo-doctor
  3. npx expo install --fix
  4. npx expo prebuild --clean
    Opened Xcode and waited until everything checked out and the first time without warnings.
  5. ran the command from package.json: "ios": "expo run:ios",

This worked for me, thanks.

@nickmaio
Copy link

I am getting this issues as well and so far all of the above comment suggestions have not worked for me. The build was working fine on SDK 49 and now not working for me anymore once upgrading to SDK 51. My dev build was perfectly fine in the expo go app.

Same issue after upgrading to SDK 51.

@landorid
Copy link

landorid commented Jun 3, 2024

Set export EAS_LOCAL_BUILD_SKIP_CLEANUP=1 so you can actually read your logs. My issue was with the provision cert, i deleted all the related certificates from the keychain and my build was successful.

@johnfau
Copy link
Author

johnfau commented Jun 6, 2024

None of previous answers applied to my issue. I updated to 50 and 51 with same result. The absence of meaningful log on the run fastlane step is the real problem here, there are countless issues which can lead to the "archive failed" message and nothing of importance in the Xcode logs.

I finally figured out that my problem was a duplicate key in a js object. It seems like the fastlane build for iOS fail if one object has a duplicate key which make me think it might be a lint error during build.

very simple steps to reproduce:

npx create-expo-app .

edit _layout.tsx with

const bug = {
    error: "",
    test: 3,
    error: 123,
};
npm install
npx expo start 

==> the app runs fine on android and iOS

npx eas-cli@latest build:configure
npx eas-cli@latest build --platform ios

==> build fail
remove the bug object from _layout.tsx

npx eas-cli@latest build --platform ios

==> build success

I don't think it is normal to fail a build for a duplicate key, especially without error message. My initial project is not on typescript, only the ESLint "no-dupe-keys" rule raise a warning.

@nickmaio
Copy link

nickmaio commented Jun 6, 2024

None of previous answers applied to my issue. I updated to 50 and 51 with same result. The absence of meaningful log on the run fastlane step is the real problem here, there are countless issues which can lead to the "archive failed" message and nothing of importance in the Xcode logs.

I finally figured out that my problem was a duplicate key in a js object. It seems like the fastlane build for iOS fail if one object has a duplicate key which make me think it might be a lint error during build.

very simple steps to reproduce:

npx create-expo-app .

edit _layout.tsx with

const bug = {
    error: "",
    test: 3,
    error: 123,
};
npm install
npx expo start 

==> the app runs fine on android and iOS

npx eas-cli@latest build:configure
npx eas-cli@latest build --platform ios

==> build fail remove the bug object from _layout.tsx

npx eas-cli@latest build --platform ios

==> build success

I don't think it is normal to fail a build for a duplicate key, especially without error message. My initial project is not on typescript, only the ESLint "no-dupe-keys" rule raise a warning.

Same here, took a few days and 50+ build attempts to locate a breaking object { error: false, error: false } in a project with about a 250K+ lines of code. Horrible experience indeed...

@Ebenezerayola
Copy link

I am getting this issues as well and so far all of the above comment suggestions have not worked for me. The build was working fine on SDK 49 and now not working for me anymore once upgrading to SDK 51. My dev build was perfectly fine in the expo go app.

Same issue after upgrading to SDK 51.

Hello, were you able to resolve it?

@kalashovkerim
Copy link

expo v50, I fix it!
just deleted @sentry/react-native

@Ebenezerayola
Copy link

expo v50, I fix it! just deleted @sentry/react-native

I'm not I have this, where can I find it so I can also delete it?

@kalashovkerim
Copy link

expo v50, I fix it! just deleted @sentry/react-native

I'm not I have this, where can I find it so I can also delete it?

package.json
than delete sentry imports in all files where are you using it

@Ebenezerayola
Copy link

expo v50, I fix it! just deleted @sentry/react-native

I'm not I have this, where can I find it so I can also delete it?

package.json than delete sentry imports in all files where are you using it

I don't have sentry

@kalashovkerim
Copy link

oh, so just carefuly read log where maybe you will see ❌ emodji, and it will tell you what package is giving you error, in my case i saw that problem with sentry package

@sousalucas
Copy link

@dev-shahidul It helped me:

  1. npx react-native-clean-project
  2. npx expo-doctor
  3. npx expo install --fix
  4. npx expo prebuild --clean
    Opened Xcode and waited until everything checked out and the first time without warnings.
  5. ran the command from package.json: "ios": "expo run:ios",

work like a charm!

@Nantris
Copy link

Nantris commented Oct 17, 2024

Continuing to see this on SDK 51 with React Native 0.75.

@gurbuzzomer
Copy link

In my case, these were the things I had to do ;

1.Go to eas credentials and recreate your provisioning and distribution certificates
2. Go to App Store Connect to see whether there are any agreements that the Account Owner has to agree to
3. If there is a path in your app.js file that has not been gitignored, remove it from gitignore

@Th1nhNg0
Copy link

Continuing to see this on SDK 51 with React Native 0.74.5

@Nantris
Copy link

Nantris commented Oct 30, 2024

FWIW our issue ended up being one of our other native dependencies silently causing the error. Remove them all and then add them back one by one to determine which is the cause.

@Th1nhNg0
Copy link

For me i have to upgrade xcode to new ios version xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eas build needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests