Code Monkey home page Code Monkey logo

Comments (12)

ceeK avatar ceeK commented on June 14, 2024 4

I've recently spent a day or so debugging this Bitrise step and this was one of my issues. The problem as far as I could see it is that this step doesn't load the workspace; it loads the project. Other tools produced by Bitrise check if the path is a workspace or project and open the correct one, but this step doesn't. As all of our schemes are defined within the workspace and not within each project it fails to find the defined scheme.

I got this step running locally using the Bitrise CLI and was playing around with it. Indeed changing the logic to open the workspace via (xcworkspace.Open(pth)) rather than the project (xcodeproj.Open(pth)) results in the scheme being visible. You can see that despite the path being described as either a project or workspace (projOrWSPath), the code only ever opens the project. This project is then used when looking up the target, which will fail.

The workaround for us was to copy-paste the relevant scheme from Foobar.xcworkspace/xcshareddata/xcschemes to Foobar.xcodeproj/xcshareddata/xcschemes. This step will then find the scheme and everything works as expected. I did think about submitting a PR but my Go isn't fantastic unfortunately and wasn't sure if this behaviour was intentional.

@bitce is it worth reopening this?

from steps-ios-auto-provision-appstoreconnect.

coreymcmahon avatar coreymcmahon commented on June 14, 2024 4

@ceeK We experienced the same issue. We needed to switch to ios-auto-provision-appstoreconnect because of Apple's changes to authentication in February 2021 so the "solution" above (reverting to the old username-password version of the build step) was not possible.

I'd like to say thanks for the information you posted in the comment above as it allowed us to find a work-around which unblocked our build process. Hopefully @bitce and/or the Bitrise team can fix this in the build step as it seems broken from our perspective (at least for any non-Capacitor Ionic projects).

For other developers who are currently blocked on this, we fixed it by adding another "Script" build step before "iOS Auto Provision with App Store Connect API":

image

In this script we simply copy all the schemes from .xcworkspace into .xcodeproj.

echo "Copying Workspace schemes to Project..."
mkdir -p platforms/ios/YOUR_SCHEME.xcodeproj/xcshareddata/xcschemes
cp -Rv platforms/ios/YOUR_SCHEME.xcworkspace/xcshareddata/xcschemes/* platforms/ios/YOUR_SCHEME.xcodeproj/xcshareddata/xcschemes/
echo "Done."

from steps-ios-auto-provision-appstoreconnect.

Tallyb avatar Tallyb commented on June 14, 2024 3

This issue was closed without resolution to the step itself (the appconnect one). Can this be reopened until a proper solution exists?

from steps-ios-auto-provision-appstoreconnect.

rogerluan avatar rogerluan commented on June 14, 2024 2

Hey all, thanks for everyone that contributed to the resolution of this issue. I believe someone at Bitrise should take a look and apply the fix that @ceeK already spent some hours investigating and debugging - that behavior doesn't seem to be "intentional" AFAICT :) I'd normally open a PR to fix this issue but since there's a decently clean workaround… 😁

@coreymcmahon thanks for the very handy script! 💯

@rachid-debu could you reopen this issue? 🙏

from steps-ios-auto-provision-appstoreconnect.

bitce avatar bitce commented on June 14, 2024

Thanks, @rachid-debu! Can you provide some context on the setup you do? Is the .xcworkspace file committed to the repository?

from steps-ios-auto-provision-appstoreconnect.

rachid-debu avatar rachid-debu commented on June 14, 2024

hi @bitce, thanks for answering.

.xcworkspace is generated with
ionic build ios --buildFlag="-UseModernBuildSystem=0"
and is not commited.

Here's the relevant part of my workflow bitrise.yml file :

- script@1:
        title: INIT & build IOS
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            # init & build ios
            npm run init
            npm run init:ios
            npm run build-ios:$BIT_NODE_ENV_SHORT
    - ios-auto-provision-appstoreconnect@0:
        inputs:
        - project_path: "$BITRISE_SOURCE_DIR/platforms/ios/Doyouno.xcodeproj"
        - scheme: Doyouno
        - build_url: "$BITRISE_SOURCE_DIR/platforms/ios/build/emulator/Doyouno.app"
        - configuration: release
        - verbose_log: 'yes'
        - distribution_type: app-store
    - xcode-archive@2:
        inputs:
        - team_id: XXX-CENSORED-XXX
        - project_path: "$BITRISE_SOURCE_DIR/platforms/ios/Doyouno.xcworkspace"
        - scheme: Doyouno
        - compile_bitcode: 'no'
        - upload_bitcode: 'no'
        - export_method: app-store

Those commands in my script step don't do anything crazy npm install, webpack, ionic build :

            # init & build ios
            npm run init
            npm run init:ios
            npm run build-ios:$BIT_NODE_ENV_SHORT

Here's my xcscheme file :

<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "0730"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "YES"
      buildImplicitDependencies = "YES">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "xxxxxxx-censored-xxxxxx"
               BuildableName = "Doyouno.app"
               BlueprintName = "Doyouno"
               ReferencedContainer = "container:Doyouno.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
      </BuildActionEntries>
   </BuildAction>
   <TestAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      shouldUseLaunchSchemeArgsEnv = "YES">
      <Testables>
      </Testables>
      <MacroExpansion>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "xxxxxxx-censored-xxxxxx"
            BuildableName = "Doyouno.app"
            BlueprintName = "Doyouno"
            ReferencedContainer = "container:Doyouno.xcodeproj">
         </BuildableReference>
      </MacroExpansion>
      <AdditionalOptions>
      </AdditionalOptions>
   </TestAction>
   <LaunchAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      debugServiceExtension = "internal"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "xxxxxxx-censored-xxxxxx"
            BuildableName = "Doyouno.app"
            BlueprintName = "Doyouno"
            ReferencedContainer = "container:Doyouno.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
      <AdditionalOptions>
      </AdditionalOptions>
   </LaunchAction>
   <ProfileAction
      buildConfiguration = "Release"
      shouldUseLaunchSchemeArgsEnv = "YES"
      savedToolIdentifier = ""
      useCustomWorkingDirectory = "NO"
      debugDocumentVersioning = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "xxxxxxx-censored-xxxxxx"
            BuildableName = "Doyouno.app"
            BlueprintName = "Doyouno"
            ReferencedContainer = "container:Doyouno.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </ProfileAction>
   <AnalyzeAction
      buildConfiguration = "Debug">
   </AnalyzeAction>
   <ArchiveAction
      buildConfiguration = "Release"
      revealArchiveInOrganizer = "YES">
   </ArchiveAction>
</Scheme>

Here's a screenshot of file structure inside xcworkspace :

Capture d’écran 2020-06-10 à 14 53 31

from steps-ios-auto-provision-appstoreconnect.

rachid-debu avatar rachid-debu commented on June 14, 2024

Maybe it is related to the Build URL of the step.
URL of the current build or local path URL to your appledeveloperportal_data.json
What does that mean ?

I tried using the BITRISE_BUILD_URL, tried using : $BITRISE_SOURCE_DIR/platforms/ios/Doyouno.app

I think this build url is expecting a previous variable created with bitrise Ionic build.

from steps-ios-auto-provision-appstoreconnect.

rachid-debu avatar rachid-debu commented on June 14, 2024

@bitce For info, I've downgraded to the prevision version of steps-ios-auto-provision-appstoreconnect --> steps-ios-auto-provision and provided the obsolete authentication method. My build is working fine now.

Regarding this new version, I didn't manage to get this working. I'll stick to the older one, until further notice.

from steps-ios-auto-provision-appstoreconnect.

mac89 avatar mac89 commented on June 14, 2024

I'm experiencing the same issue with a Cordova generated project. The file structure:

+ file='/Users/vagrant/git/platforms/ios/MTinfo 3000 TST.xcworkspace'
+ ls -R -ltr '/Users/vagrant/git/platforms/ios/MTinfo 3000 TST.xcworkspace'
total 8
drwxr-xr-x  3 vagrant  staff   96 Jun 25 14:19 xcshareddata
-rw-r--r--  1 vagrant  staff  233 Jun 25 14:21 contents.xcworkspacedata
/Users/vagrant/git/platforms/ios/MTinfo 3000 TST.xcworkspace/xcshareddata:
total 0
drwxr-xr-x  3 vagrant  staff  96 Jun 25 14:19 xcschemes
/Users/vagrant/git/platforms/ios/MTinfo 3000 TST.xcworkspace/xcshareddata/xcschemes:
total 8
-rw-r--r--  1 vagrant  staff  3399 Jun 25 14:19 MTinfo 3000 TST.xcscheme

This step's output:

Config:
- BuildAPIToken: [REDACTED]
- BuildURL: https://app.bitrise.io/build/b5ce7f49e9e3eb70
- ProjectPath: /Users/vagrant/git/platforms/ios/MTinfo 3000 TST.xcworkspace
- Scheme: MTinfo 3000 TST
- Configuration: 
- Distribution: app-store
- MinProfileDaysValid: 0
- CertificateURLList: [REDACTED]
- CertificatePassphraseList: 
- KeychainPath: /Users/vagrant/Library/Keychains/login.keychain
- KeychainPassword: *****
- VerboseLog: false
Creating AppstoreConnectAPI client
the client created for https://api.appstoreconnect.apple.com/
Analyzing project
Failed to analyze project: failed to find the main target of the scheme (MTinfo 3000 TST): failed to find scheme (MTinfo 3000 TST) in project: scheme MTinfo 3000 TST not found in MTinfo 3000 TST

from steps-ios-auto-provision-appstoreconnect.

rachid-debu avatar rachid-debu commented on June 14, 2024

hi @mac89 sorry for late answer. but I've managed to solve my issue by using the older version of this bitrise step :
https://github.com/bitrise-steplib/steps-ios-auto-provision
it is the basic step iOS Auto Provision (without app store connect API).
for this one to work, you will have to provide your apple credentials in your bitrise settings page.

let me know if this worked for you.

@bitce this new version of the step seem to have some issues, maybe needs to be investigated.

from steps-ios-auto-provision-appstoreconnect.

mac89 avatar mac89 commented on June 14, 2024

hi @mac89 sorry for late answer. but I've managed to solve my issue by using the older version of this bitrise step :
https://github.com/bitrise-steplib/steps-ios-auto-provision
it is the basic step iOS Auto Provision (without app store connect API).
for this one to work, you will have to provide your apple credentials in your bitrise settings page.

let me know if this worked for you.

@bitce this new version of the step seem to have some issues, maybe needs to be investigated.

I resorted to this as well. I perused through the source code, but could not find the cause.

from steps-ios-auto-provision-appstoreconnect.

godrei avatar godrei commented on June 14, 2024

Hi all, we released a fix for this issue in version 1.0.2.

Please update to the latest version of the step, if you need more info/help just let us know by opening a new issue!

from steps-ios-auto-provision-appstoreconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.