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
Fix multiplatform iOS builds #21319
Fix multiplatform iOS builds #21319
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Ensure fastlane can parse Xcode 14 projects
@zachwaugh Thank you for creating this PR. We run into a similar issue with one of our applications, it would be great to see this supported in fastlane. Is there a plan to merge this PR and get it into a next release @joshdholtz. Any way that we could help there? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, it looks great!
Hi @zachwaugh, thanks for your MR. I have Fastlane and Gym 2.216.0 and I am still having the issue that you mentioned. I am using Xcode 15.1 and Codemagic. Here is the information +-----------------------------------------------------------------------------------------------------------------+ Here is the gym lane: desc "Release a new version to TestFlight"
lane :release do |options|
create_keychain(
name: ENV["MATCH_KEYCHAIN"],
password: ENV["MATCH_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
add_to_search_list: true,
verbose: true
)
# Fetch certificates and provisioning profiles using match
match(type: "appstore",app_identifier: "art.truffle.fm", readonly: true, keychain_name: ENV["MATCH_KEYCHAIN"], keychain_password: ENV["MATCH_PASSWORD"]) # readonly: true is recommended for CI
# Increment version and build number
bump_and_push_version(options)
# Build the IPA
gym(
scheme: truffle_scheme,
export_method: 'app-store',
destination: "generic/platform=iOS",
sdk: "iphoneos"
)
# Define the API key for App Store Connect
api_key = app_store_connect_api_key(
key_id: ENV["APPSTORE_API_KEY"],
issuer_id: ENV["APPSTORE_ISSUER_ID"],
key_content: ENV["AUTH_KEY"],
in_house: false # set to true for enterprise and false for individual accounts
)
# Upload to TestFlight
pilot(
api_key: api_key,
ipa: lane_context[SharedValues::IPA_OUTPUT_PATH],
skip_waiting_for_build_processing: true
)
cleanup_git_configuration
end Is there any workaround? Here is the output error:
|
@ConradoMateu this PR was merged on Oct 7 and last release was Sept 18, so doesn't look like it's in a release yet, you'll need to target the |
I think this probably fixes #20826? |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
Currently using a multiplatform Xcode project (Xcode > New Project > Multiplatform App) will fail to build for iOS from fastlane using
build_app
with aPKG invalid
error. The reason is the platform check for whether to do an iOS buildGym.building_for_ios?
returnsfalse
, so it attempts to build an iOS app like a macOS app.Description
This fixes the above error by explicitly checking for cases where we might be a multiplatform app (e.g. multiple
SUPPORTED_PLATFORM
properties) and checking whichsdk
is being used. I'm not sure if this is the correct fix, I couldn't find good documentation on the right way to choose a platform to build for a multiplatform app usingxcodebuild
. Passing thesdk: "iphoneos"
orsdk: "macosx"
option seemed to work though, so I'm expecting that is required and what we need to check. If there is alternative way to informxcodebuild
about the platform, I'm happy to change the check.I added a new example project created using the Multiplatform App template and some related tests. I'm not a Ruby programmer and not familiar with the codebase, so let me know if there is a better way to do any (or all) of this.