bitrise-steplib / steps-xcode-build-for-simulator

MIT License
4 stars 18 forks source link

Failed to export the artifacts, error: failed to fetch project's targets, error: Failed to found scheme (SOME SCHEME) in project #13

Closed adebree closed 2 years ago

adebree commented 5 years ago

Trying to make a Simulator build of an Ionic app, but getting an error when exporting the build' Simulator app. The build of the IPA itself is successful (using the Ionic Archive step). But running the Xcode build for simulator results eventually in an error, although the building itself seems to succeed. Only in the final part of the step an error is raised about not finding the scheme in the project:

+------------------------------------------------------------------------------+
| (23) xcode-build-for-simulator@0.10.0                                        |
+------------------------------------------------------------------------------+
| id: xcode-build-for-simulator                                                |
| version: 0.10.0                                                              |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-05-23T08:32:34-07:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[08:32:34]  * [OK] Step dependency (xcode) installed, available. 
INFO[08:32:34]  * [OK] Step dependency (go) installed, available. 
Config:
- ProjectPath: /Users/vagrant/git/platforms/ios/SOME PROJECT.xcworkspace
- Scheme: SOME SCHEME
- Configuration: Debug
- ArtifactName: 
- XcodebuildOptions: 
- Workdir: /Users/vagrant/git
- OutputDir: /Users/vagrant/deploy
- IsCleanBuild: false
- OutputTool: xcpretty
- SimulatorDevice: iPhone 8
- SimulatorOsVersion: latest
- SimulatorPlatform: iOS
- DisableIndexWhileBuilding: true
- VerboseLog: true

Step determined configs:
- xcodebuildVersion: Xcode 10.1 (Build version 10B61)

Checking if output tool (xcpretty) is installed
- xcprettyVersion: 0.3.0

Simulator info
Latest simulator for iPhone 8 = 8A1F9274-CD16-485A-A84C-6FCD603E2FAF

Running build
[08:32:43] $ set -o pipefail && xcodebuild "-workspace" "/Users/vagrant/git/platforms/ios/SOME PROJECT.xcworkspace" "-scheme" "SOME SCHEME" "-configuration" "Debug" "CODE_SIGN_IDENTITY=" "CODE_SIGNING_REQUIRED=NO" "PROVISIONING_PROFILE_SPECIFIER=" "PROVISIONING_PROFILE=" "DEVELOPMENT_TEAM=" "-destination" "id=8A1F9274-CD16-485A-A84C-6FCD603E2FAF" "COMPILER_INDEX_STORE_ENABLE=NO" "build" | xcpretty
....
▸ Generating 'SOME\ PROJECT.app.dSYM'
▸ Touching SOME\ PROJECT.app (in target: SOME TARGET)
▸ Build Succeeded

Copy artifacts from Derived Data to /Users/vagrant/deploy
Scheme build dir: /Users/vagrant/Library/Developer/Xcode/DerivedData/SOME_PROJECT-aixhwmehymlkfgbulzpnmsjclgjm/Build/Products/Debug-iphonesimulator
Failed to export the artifacts, error: failed to fetch project's targets, error: Failed to found scheme (SOME SCHEME) in project

The input of the step:

    - xcode-build-for-simulator@0.10.0:
        is_skippable: true
        inputs:
        - project_path: "$BITRISE_SOURCE_DIR/platforms/ios/${APPLICATION_NAME}.xcworkspace"
        - scheme: "$APPLICATION_NAME"
        - xcodebuild_options: "-UseModernBuildSystem=0"
        - verbose_log: 'yes'
        - simulator_device: iPhone 8
bitce commented 5 years ago

Hi @adebree!

Thanks for the report! We'll escalate it to the team and get back to you ASAP.

lszucs commented 5 years ago

Hi @adebree,

Can you please provide a failing build URL and enable the support user?

https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/

adebree commented 5 years ago

@lszucs I've worked around the issue by using the ionic-archive step (it's an ionic app..) a second time in the workflow for doing the debug simulator build. That results in a working simulator build for us, and we don't need the 'xcode-build-for-simulator' anymore.

For reference, the last failed build using this step was: https://app.bitrise.io/build/16f42566f9864990 do you still need the support user access since we don't use this step anymore? (if it's me, we can close this issue)

lszucs commented 5 years ago

@adebree

Great to hear you were able to solve it. Thanks for sending the build for reference, we'll check it out and get back to you if we find an actual bug in the step. I'll leave the issue open, so it would not be forgotten.

kgoplan commented 3 years ago

I'm seeing this issue. This is still a problem?

nikolaytw commented 3 years ago

Hello @bitce : issue is still there. It stops us from comfortable usage of this step Our stack:

  1. We have workspace with a lot of projects.
  2. We need always build workspace, because of not trivial dependency graph.
  3. Scheme is shared in workspace, cos projects are actually generated on the flight

And here is interesting things happening: step searching for scheme in wrong place during exporting artefacts. Here is approx stack: 1: https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/blob/92907f5096554347d916c092d51f3ba74a6d2c91/main.go#L275 2: https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/blob/92907f5096554347d916c092d51f3ba74a6d2c91/main.go#L301 3: https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/blob/92907f5096554347d916c092d51f3ba74a6d2c91/main.go#L431

In the begining of build used workspace, which we provided. But later, tool for some reason need find target of scheme, and for this it tried to read specifically in project, which is not expected, since we didn't even provide project, only workspace.

So I would propose fixes:

  1. Hot fix allow stop exporting artifacts, cos issue in it
  2. Fix buildTargetDirForScheme to work with provided path of project or workspace. And search scheme only there.

Right now I have to duplicate scheme and totally unhappy....

bitce commented 3 years ago

Hi @nikolaytw! Thanks a lot for your detailed report. Can you please include an URL to a build where this happens so I can forward that with these details? Thanks a lot!

nikolaytw commented 3 years ago

@bitce Link: https://app.bitrise.io/build/bbc4aabbd305e5ba#?tab=log

bitce commented 3 years ago

Thank you! I'd also like to request support access that povides us with further information, which can be crucial in situations where the errors aren't easy to recreate.

nikolaytw commented 3 years ago

@bitce sorry for long silence. I would rather not add any permission to our Bitrise app. If you don't have it by default, I need go through our IT to allow such access. But does Bitrise have a free teir or so? I described steps specifically, it is easy to reproduce them. Can I just create dummy project and reproduce on it? Cos giving access to our production code might be not the easiest thing to do.

bitce commented 3 years ago

Hi @nikolaytw! I completely missed this, sorry. I do want to notethat access to the app does not provide us access to the source code (except if/when using the Remote Access feature.) but completely understand the security concerns anyhow.

Bitrise indeed has a free tier, if you have the capacity to create project where the problem is reproducible and you can share with us, that would be extremely helpful.

pacu commented 3 years ago

Failed to export the artifacts, error: failed to fetch project's targets, error: failed to get scheme (ECC-Wallet) from project (/Users/vagrant/git/wallet/ECC-Wallet.xcodeproj), error: scheme ECC-Wallet not found in ECC-Wallet

image

image

This should actually work. But it doesn't

~this fixes the issue.~ Well it did fix it once but now it constantly fails image

It's weird that a project set up (by default by bitrise) like this fails. Probably the calling component is invoking this step with the incorrect parameter. Otherwise I don't see how passing an .xcworkspace path could end in this branch of the readScheme

https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/blob/92907f5096554347d916c092d51f3ba74a6d2c91/main.go#L354-L369

Roland-Bak commented 3 years ago

Hello @pacu 👋

Can you please send us the log file or the URL of the related build and also enable Support Access on the Settings tab of the app ( https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/ ) so that we can take a more in-depth look? 🙂 You can also send this in a ticket at https://support.bitrise.io/hc/en-us, if you prefer a private channel to share this information.

pacu commented 3 years ago

I did send a ticket :)

it's ticket #16559

rogerluan commented 3 years ago

Hey @Roland-Bak @bitce , I think this issue is similar to this one https://github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/issues/7 which got resolved in this release https://github.com/bitrise-steplib/steps-ios-auto-provision-appstoreconnect/releases/tag/1.0.2

I applied the same hotfix described in that issue, and it solved my problem. Also, it's worth noting that for some reason this is only happening in one workflow of mine but not the other (same project), the only difference between them is that one is built for "dev" (adhoc export method) and the other is "staging" (app-store export method).

For reference here's the script I added right before the Xcode build for simulator step:

# This is a hotfix for this issue: https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/issues/13#issuecomment-875005242
# When that issue gets resolved, this hotfix script can be completely deleted.

echo "Copying Workspace schemes to Project..."
mkdir -p put-your-app-name-here.xcodeproj/xcshareddata/xcschemes
cp -Rv put-your-app-name-here.xcworkspace/xcshareddata/xcschemes/* put-your-app-name-here.xcodeproj/xcshareddata/xcschemes/
echo "✅ Done."
bitrise-coresteps-bot commented 2 years ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

rogerluan commented 2 years ago

@Roland-Bak @bitce was this issue addressed already? Please see my message above ☝️

Roland-Bak commented 2 years ago

Hello @rogerluan 👋

Sorry for the late reply, Github is not directly channeled into our supporting system and sometimes can take an extensive amount of time to get to. Do you still have this issue? If you do, could you please open a ticket at https://www.bitrise.io/bitrise-support (so it gets the attention it needs), and submit both the build made for "dev" and the one for "staging", so we could compare the two? This will most likely need help from the developers as well, and the more information available, the better.

Thank you! 🙂

pacu commented 2 years ago

I don't see the issue anymore

On Thu, Dec 23, 2021 at 8:12 AM Roland-Bitrise @.***> wrote:

Hello @rogerluan https://github.com/rogerluan 👋

Sorry for the late reply, Github is not directly channeled into our supporting system and sometimes can take an extensive amount of time to get to. Do you still have this issue? If you do, could you please open a ticket at https://www.bitrise.io/bitrise-support (so it gets the attention it needs), and submit both the build made for "dev" and the one for "staging", so we could compare the two? This will most likely need help from the developers as well, and the more information available, the better.

Thank you! 🙂

— Reply to this email directly, view it on GitHub https://github.com/bitrise-steplib/steps-xcode-build-for-simulator/issues/13#issuecomment-1000230550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADWFKEPFMJTCVW3I7B4Y5LUSL73RANCNFSM4HPNNVIQ . You are receiving this because you were mentioned.Message ID: <bitrise-steplib/steps-xcode-build-for-simulator/issues/13/1000230550@ github.com>

-- Francisco Gindre Software Developer

bitrise-coresteps-bot commented 2 years ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 2 years ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.