Is it possible to specify which ios schema or android product flavor to build using expos new EAS build? I’d like to run this in my local terminal as a package.json script command. Alternatively could something like this could be done in Circle CI?
If you want to specify that from the command line, you will need to create separate profiles in eas.json and run builds with --profile flag. By default release profile is used. eas build --profile profile1
I have a scheme called UAT, but when i run eas build, i get an error saying “Error: scheme ‘UAT’ does not exist”, even though it does and it is also defined in the eas.json
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Information about project "Payright":
Targets:
Payright
Build Configurations:
Debug
UAT.Debug
DEV.Debug
Release
UAT.Release
DEV.Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
DEV
Payright
UAT
Is the error displayed in eas-cli or in build logs?
If in cli please include the entire error and some logs before it with env DEBUG=*
If in build logs please send link to the build or account name of the owner/organization (I don’t see any builds for praveen_payright account)
If the error happens on the EAS builder then one issue I have seen before similar to this was caused by canse insetivity of macos system, If that is the case git config core.ignorecase false before build should fix that.
So if I remove the scheme from eas.json then I get this error:
All credentials are ready to build @payright/payright (com.payright.customer.uat)
Error: Bundle identifier is not configured correctly in your Xcode project. Please run "eas build:configure" to configure it.
at Object.validateAndSyncProjectConfigurationAsync (/usr/local/lib/node_modules/eas-cli/build/build/ios/configure.js:39:23)
at Object.ensureProjectConfiguredAsync (/usr/local/lib/node_modules/eas-cli/build/build/ios/build.js:58:31)
at withAnalyticsAsync.successEvent (/usr/local/lib/node_modules/eas-cli/build/build/build.js:26:60)
at withAnalyticsAsync (/usr/local/lib/node_modules/eas-cli/build/build/build.js:119:30)
at Object.prepareBuildRequestForPlatformAsync (/usr/local/lib/node_modules/eas-cli/build/build/build.js:26:15)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.prepareIosBuildAsync (/usr/local/lib/node_modules/eas-cli/build/build/ios/build.js:50:12)
at async startBuildsAsync (/usr/local/lib/node_modules/eas-cli/build/build/create.js:45:39)
at async Object.buildAsync (/usr/local/lib/node_modules/eas-cli/build/build/create.js:21:29)
at async Build.run (/usr/local/lib/node_modules/eas-cli/build/commands/build/index.js:72:13)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have defined the bundleIdentifier in app.json as com.payright.customer.uat
After running eas:build:configure and choosing the correct bundleIdentifier, I can create a build only if i remove the “scheme” from eas.json. But then the cli does not prompt me to select a scheme. So I have got a build for the wrong scheme.
Error: Bundle identifier is not configured correctly in your Xcode project.
We don’t handle all the cases for xcode projects, so this validation is failing because we are not aware of how CFBundleIdentifier is constructed and we just read value of PRODUCT_BUNDLE_IDENTIFIER. This is sth we plan to improve in the future.
I’m assume that you are using different bundle identifiers for different schemes, or at least the project is ready to support that?
You can remove $(BUNDLE_ID_SUFFIX) if you don’t need that
From what I see you should still be prompted for scheme in the second case unless you have --non-interactive set, but either way, it’s not the core of the problem.
So, the issue was that i did not make the schemes “shared” in xcode, and I also removed the “BUNDLE_ID_SUFFIX” for CFBundleIdentifier, and added that experimental flag as well.
Really appreciate your help on this one.
I just had one last question if you don’t mind.
If the app.json specifies the version, versionCode, & buildNumber, are we required to manually update these values in app/build.gradle and Info.plist with this information, or will it be done by the EAS build service?
For android you need to handle it yourself, only runtimeVersion/sdkVersion is synced during build
For ios
if you use autoincrement option it will handle it for you
otherwise you also need to do that manually
an alternative could be to run eject, but depending on the structure of your project it might not work (eject is support mostly for project that closely resemble managed workflow template)
the experimental flag should not be necessary If you remove BUNDLE_ID_SUFFIX and run configure (remove experimental flag before running configure)